- A successful branch management
git-flow
- Some problems
- Solution
-R | --remote
option
- Conclusion
- Do you have any questions?
- with IRC(#git)
- One more thing
git now
- Subversion is dead.
- Branching and merging are no longer something to be afraid of
- Master
- A production-ready state
- Develop
- for the next release
- Feature
- Release
- Hotfix
branch off | merge back |
---|---|
delevelp | develop |
branch off | merge back |
---|---|
develop | develop and master |
branch off | merge back |
---|---|
master | develop and master |
Git extensions to provide high-level repository operations for the branching model
https://github.com/nvie/gitflow
$ brew install git-flow
$ git checkout -b develop origin/master
$ git flow init
-
Start feature branch
$ git flow feature start smartphone-version
This means:
$ git checkout -b feature/smartphone-version develop
-
Finish feature branch
$ git flow feature finish smartphone-version
This means:
$ git checkout develop $ git merge --no-ff feature/smartphone-version $ git branch -d feature/smartphone-version
-
Start release branch
$ git flow release start 1.0
This means:
$ git checkout -b release/1.0 develop
-
Finish release branch
$ git flow release finish 1.0
This means:
$ git checkout master $ git merge --no-ff release/1.0 $ git tag -a 1.0 $ git checkout develop $ git merge --no-ff release/1.0 $ git branch -d release/1.0
-
Start hotfix branch
$ git flow start 1.1
This means:
$ git checkout -b hotfix/1.1
-
Finish hotfix branch
$ git flow finish 1.1
This means:
$ git checkout master $ git merge --no-ff hotfix/1.1 $ git tag -a 1.1 $ git checkout develop $ git merge --no-ff hotfix/1.1 $ git branch -d hotfix/1.1
git-flow
dose not concern for remote repository.
Therefore, you need to sync to remote repository with hands.
Add -R | --remote
option
https://github.com/iwata/gitflow
$ brew install https://github.com/iwata/gitflow/raw/master/git-flow.rb
-
Start feature branch
$ git flow feature start -R smartphone-version2
This means:
$ git checkout -b feature/smartphone-version2 develop $ git push -u origin feature/smartphone-version2
-
Finish feature branch
$ git flow feature finish -R smartphone-version2
This means:
$ git checkout develop $ git merge --no-ff feature/smartphone-version2 $ git branch -d feature/smartphone-version2 $ git push origin develop $ git push origin :feature/smartphone-version2
-
Start release branch
$ git flow release -R start 2.0
This means:
$ git checkout -b release/2.0 develop $ git push -u origin release/2.0
-
Finish release branch
$ git flow release finish -R 2.0
This means:
$ git checkout master $ git merge --no-ff release/2.0 $ git tag -a 2.0 $ git checkout develop $ git merge --no-ff release/2.0 $ git branch -d release/2.0 $ git push origin master $ git push origin develop $ git push --tags $ git push origin :release/2.0
-
Start hotfix branch
$ git flow start -R 2.1
This means:
$ git checkout -b hotfix/2.1 $ git push -u origin hotfix/2.1
-
Finish hotfix branch
$ git flow finish -R 2.1
This means:
$ git checkout master $ git merge --no-ff hotfix/2.1 $ git tag -a 2.1 $ git checkout develop $ git merge --no-ff hotfix/2.1 $ git branch -d hotfix/2.1 $ git push origin master $ git push origin develop $ git push --tags $ git push origin :hotfix/20111201-1234
- Subversion is dead.
git-flow
is very useful.- But it has some problems.
- To use advanced
git-flow
is the solution.- Add
-R | --remote
option
- Add
git-now
is a command-line tool for light and temporary commit.
It commits with a log message from time now and diff.
-
https://github.com/iwata/git-now
$ brew install git-now $ brew install --zsh-completion git-now