gitflow | git |
---|---|
git flow init |
git init |
git commit --allow-empty -m "Initial commit" |
|
git checkout -b develop master |
gitflow | git |
---|---|
N/A | git remote add origin [email protected]:MYACCOUNT/MYREPO |
gitflow | git |
---|---|
git flow feature start MYFEATURE |
git checkout -b feature/MYFEATURE develop |
gitflow | git |
---|---|
git flow feature publish MYFEATURE |
git checkout feature/MYFEATURE |
git push origin feature/MYFEATURE |
gitflow | git |
---|---|
git flow feature pull origin MYFEATURE |
git checkout feature/MYFEATURE |
git pull --rebase origin feature/MYFEATURE |
gitflow | git |
---|---|
git flow feature finish MYFEATURE |
git checkout develop |
git merge --no-ff feature/MYFEATURE |
|
git branch -d feature/MYFEATURE |
gitflow | git |
---|---|
N/A | git push origin develop |
git push origin :feature/MYFEATURE (if pushed) |
gitflow | git |
---|---|
git flow release start 1.2.0 |
git checkout -b release/1.2.0 develop |
gitflow | git |
---|---|
git flow release publish 1.2.0 |
git checkout release/1.2.0 |
git push origin release/1.2.0 |
gitflow | git |
---|---|
N/A | git checkout release/1.2.0 |
git pull --rebase origin release/1.2.0 |
gitflow | git |
---|---|
git flow release finish 1.2.0 |
git checkout master |
git merge --no-ff release/1.2.0 |
|
git tag -a 1.2.0 |
|
git checkout develop |
|
git merge --no-ff release/1.2.0 |
|
git branch -d release/1.2.0 |
gitflow | git |
---|---|
N/A | git push origin master |
git push origin develop |
|
git push origin --tags |
|
git push origin :release/1.2.0 (if pushed) |
gitflow | git |
---|---|
git flow hotfix start 1.2.1 [commit] |
git checkout -b hotfix/1.2.1 [commit] |
gitflow | git |
---|---|
git flow hotfix finish 1.2.1 |
git checkout master |
git merge --no-ff hotfix/1.2.1 |
|
git tag -a 1.2.1 |
|
git checkout develop |
|
git merge --no-ff hotfix/1.2.1 |
|
git branch -d hotfix/1.2.1 |
gitflow | git |
---|---|
N/A | git push origin master |
git push origin develop |
|
git push origin --tags |
|
git push origin :hotfix/1.2.1 (if pushed) |
It is possible to automatically push after
finish
ing a git flow branch.For instance, at my company after opening and publishing a feature/release/hotfix, we manually open a PR on github from the release to our production branch for the purpose of code review, and after the PR is approved, instead of clicking the merge button on github, we
finish
using git flow to make sure the commit is merged in all the relevant branches.So in our case, when we "finish" a git flow branch, it makes sense to immediately push the branches + tags to the remote instead of having to enter the git flow commands directly.
We are using git flow (AVH edition) and there are useful git settings that allow pushing directly after finishing a git flow branch
After entering this config, git flow will automatically push the branches on the remote, thus saving extra time and avoiding confusion.
Here is an example of terminal output when doing a
git flow release finish
after committing a changelog on the release branch (unlike the VD model, I prefer to have my production branch named "production" instead of "master, and our development branch "master" instead of "develop")More info on the reference page of the git flow AVH config
EDIT :
Our frontend devs had been using flags to achieve the same purpose
git flow hotfix finish -Fp XX.X.X
(fetch + push)