Git Practise
Branchs:
master
branch is protected,master
should be always deployable!alpha_release
branch could be auto deployed to Alpha Environment, and it is NOT proctected. It is regard as our CI/CD branch.- developer could create new branch like
feature_add_button
,dev_optimize_performance
etc.
Developer and Deploy
- One developer does coding on his local feature. (Or, he could push his feature branch to remote to share the development with others.)
- If developer want to release to Alpha Environment, just merge his branch to
alpha_release
- If project owner wants to release to Prod Environment, he should merge
alpha_release
tomaster
or cherry-pick dev-branches tomaster
.
Then, always only deploymaster
to Pord. (and add a tag tomaster
is also helpful).
In a All
- When seperate developers coding on different projects (those may have dependencies), they could communicate with
alpha_release
:- Before:
- A: Hey, dude, my excellent job’s done! Check them!
- B: ‘mkay, you are on which branch?
- A: Oh, my branch is “my_excellent_work_1”. Pull and try it.
- B: ‘mkay. (pull and checkout, run A’app.) Oops, there is some Exception..
- A: Woo, that maybe, some environment issue, try this and that…
- B: …
- Now:
- A: Hey, dude, my excellent job’s done! Check xxx(project module)’s new API, they are on Alpha now.
- B: Ok, wait a minutes. (Change config to Alpha Environment, reload the app). Hurray, that sucks!
- Before:
- When project owner deploy
master
, check thealpha_release
‘s update carefully! (because,alpha_release
may contain some unstable commit.
That’s also means CI onalpha_release
andmaster
is strongly recommanded!) - Tip: don’t directly coding on
alpha_release
, use ‘checkout and merge’ mode. - Tip: keep commit focus on one feature, try
git rebase -i
.
- When seperate developers coding on different projects (those may have dependencies), they could communicate with