Skip to content

Instantly share code, notes, and snippets.

@miqui
Created October 27, 2015 00:43
Show Gist options
  • Save miqui/71cd8454ad8e906d9c3d to your computer and use it in GitHub Desktop.
Save miqui/71cd8454ad8e906d9c3d to your computer and use it in GitHub Desktop.
git tips - 2
// Create a new branch and fetch frome remote branch
$ git checkout -b hotfix origin/hotfix
// Create a branch based one commit
// Fix branch
$ git checkout -b hotfix 7bda10c6488835f4c54079cec78cc539a0c152c6
$ git push origin hotfix
// Create a new branch hotfix based on master
$ git checkout -b hotfix master
// Merge branch hotfix ->master
$ git checkout master
$ git merge --no-ff hotfix
// Delete branch local and remote
$ git branch -d hotfix
$ git push origin :hotfix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment