Skip to content

Instantly share code, notes, and snippets.

@mallond
Last active November 3, 2016 15:08
Show Gist options
  • Save mallond/6172ba0ed865f8b70a73cb3ec8f84872 to your computer and use it in GitHub Desktop.
Save mallond/6172ba0ed865f8b70a73cb3ec8f84872 to your computer and use it in GitHub Desktop.
Git Rebase
# Merge a branch B1 in N1 with rebase
git checkout N1
git pull
git checkout B1
git rebase N1
git checkout N1
git rebase B1
# Yet another approach
https://medium.com/@sda/git-rebase-based-workflow-cheat-sheet-3e37ad39da66#.lovwmnkbo
git remote add upstream https://github.com/userOrOrg/repoName.git
git pull upstream master
git checkout -b "awesomeFeature"
git add .
git commit -m "Added an awesome feature"
git pull --rebase upstream master
git rebase --continue
git push origin awesomeFeature
git checkout master
git pull upstream master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment