At this moment i hope that everyone has done the exercise at Git exercise (if you did not, you should, now). After knowing some of the basic Git command, it is time to introduce the workflow (i.e how we will work together, branches definition).
This will be a summary this topic by Vincent Driessen (not the guy from FF).
master
: stable release, what will other people will clone and use.maindev
: lasted changes for the next release intomaster
.
Always tag a release when merge into master
(aka version number).
feature
: where we work the most, branch off frommaindev
, exist locally. If many people need to work on the same feature,fetch
each other.release
: contains the next release, allowmaindev
branch to continue develop for further future release, branch offmaindev
and merge back tomaster
ormaindev
.hotfix
: fix bug which we already publish in master, branch frommaster
and merge back tomaster
andmaindev
(we want both branches to be fixed).
-
Check feature cards on Trello.
-
Create new feature branch in local repo.
git checkout -b feature-xxx maindev
Translate: Create new branch named feature-xxx
branch off develop
.
3. Work on the feature.
4. When finish, push feature-xxx to remote repo.
git push maindev feature-xxx
- Create pull request on Github.
- Check issue on Github or bug card on Trello.
- Work the same as feature, but branch from where the bug is found and push back into it. Create pull request as usual.
Start with singular verb, follow with what you have done in that commit briefly. Ex:
Add xxx part of feature yyyy Fix bug number xxx in branch yyyy
When edit commits using rebase, remember to change the commit message to info about the rebase.
Squash ... to ... Edit ...
feature-xxx
or hotfix-xxx
.