7. Distributed Version
Control System
- Decentralized but centralized
- Git has remote repo (which is
same as everyone)
- Every develop has own local
repo
- All develop have a copy of the
code
7
9. “
9
Why Git is needed?
- The life before ({date}.zip, ftp, mess... )
- Flexibility
- Allow different working Env ☝
- Allow different developers works on
same project (add / changing code)
- Peer reviews
- Adding / revert version of the project
- 70% dev (stackoverflow), Basic
standard of code sharing
14. “
14
GIT Structure
Master
- always product-ready. Always GIT PULL
REQUEST only. No direct commit
Develop
- always latest branch before next release.
Always merge / git pull request from
feature branch.
Feature
- New feature: when done, delete this branch
Details: https://nvie.com/posts/a-successful-git-branching-model/
15. GIT Rules 👪
When we share a git repo, we
need to follow some rules to keep
it clean for everyone to access
15
16. ◇ Use .gitingore to avoid sharing privacy file
◇ git pull before work on anything
◇ Always pull from develop to start
◇ Each ENV (DEV / prod) should belong to one branch
◇ keep branch short life (* except develop / master)
◇ Long live branch don’t diverge (locale commit)
◇ Keep clean and easy to track for everyone
◇ Use Label / Tag if need other to notice
◇ Each feature branch should be follow a ticket
◇ Check the code after pull request
+ continuous integration
Please Do 🙆 ✅
16
17. Don’t Don’t ...🙅 ❌
◇ Use GIT as a file storage / NAS
■ Its keep track of code and project version
◇ Don’t commit / add private keys 🔑 / hash / token (it leaves in git history)
◇ Local merge without pushing ( all others cant keep track )
◇ Don’t directly commit to master
◇ If doing HK, TW, KR , … , don’t one branch HK, TW, KR. using env to config
◇ Don’t open your own branch. Eg. Kelvin branch which is not shareable /
distributed to anyone.
◇ Don’t Pull request / commit if the feature is not done
■ If we have to, label ‘not complete’
◇ Don’t Commit conflict
17
18. GIT FLOW 🐘 > 🐉
- Rules + structure = git dev standard => GIT FLOW
- There has many ways
- Ready made command for easier git
apt-get install git-flow
git flow init
Detail : https://danielkummer.github.io/git-flow-cheatsheet/
18