Skip to content

Instantly share code, notes, and snippets.

@mariusbutuc
Created September 13, 2012 15:05
Show Gist options
  • Save mariusbutuc/3714934 to your computer and use it in GitHub Desktop.
Save mariusbutuc/3714934 to your computer and use it in GitHub Desktop.
Git (hotfix) branch merging workflow
[IMCloud (hotfix_<id>)]$ git checkout develop
[IMCloud (develop)]$ git pull origin develop
[IMCloud (develop)]$ git pull origin hotfix_<id>
< If there are any conflicts, solve them and: >
[IMCloud (develop|MERGING)]$ git add <files to be committed>
< Commit changes introduced by solving conflicts >
[IMCloud (develop|MERGING)]$ git commit -m "Pulling from branch hotfix_<id>"
[IMCloud (develop)]$ git push origin develop
[IMCloud (develop)]$ git checkout test
[IMCloud (test)]$ git pull origin test
[IMCloud (test)]$ git pull origin hotfix_<id>
< If there are any conflicts, solve them and: >
[IMCloud (test|MERGING)]$ git add <files to be committed>
< Commit changes introduced by solving conflicts >
[IMCloud (test|MERGING)]$ git commit -m "Pulling from branch hotfix_<id>"
[IMCloud (test)]$ git push origin test
[IMCloud (master)]$ git checkout master
[IMCloud (master)]$ git pull origin master
[IMCloud (master)]$ git merge --no-ff hotfix_<id>
< If there are any conflicts, solve them and: >
[IMCloud (master|MERGING)]$ git add <files to be committed>
< Commit changes introduced by solving conflicts >
[IMCloud (master|MERGING)]$ git commit -m "Merging branch hotfix_<id>"
[IMCloud (master)]$ git push origin master
[IMCloud (master)]$ git branch -d hotfix_<id>
[IMCloud (master)]$ git push origin --delete hotfix_<id>
[IMCloud (master)]$ git checkout develop
# See also: http://nvie.com/posts/a-successful-git-branching-model/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment