Skip to content

Instantly share code, notes, and snippets.

@robrez
Created September 8, 2016 18:43
Show Gist options
  • Save robrez/3ff1d4c3b09785cc486df9f164124a02 to your computer and use it in GitHub Desktop.
Save robrez/3ff1d4c3b09785cc486df9f164124a02 to your computer and use it in GitHub Desktop.
git notes

#squash commits / rebase or merge

##If needed add upstream

git remote -v
git remote add upstream https://github.com/repo/project.git
git fetch upstream
git rebase upstream/master
git rebase --interactive HEAD~2
#note: per stackoverflow "git pull --rebase upstream master is analogous to git fetch upstream && git rebase upstream/master"

##Squashing

#  we are going to squash c into b 
pick b76d157 b
pick a931ac7 c

# squash c into b
pick b76d157 b
s a931ac7 c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment