After some playing with remotes I ended up with all my commits being doubled. E.g. instead of
C3107
..
C3
C2
C1
I got
C31
git rebase -i #commit id where you want to start squashing#
This will bring up an interactive session. Switch everything but the first commit on the stack to fixup or squash.
pick 07520cd Caught file exists issue. # this is last commit
fixup 3b71b9f Added README. # fixup will squash the commit
# Rebase b041966..3b71b9f onto b041966
#
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x, exec = run command (the rest of the line) using shell
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
#
# However, if you remove everything, the rebase will be aborted.
#
# Note that empty commits are commented out
I have a git koan (koan 8) that walks you through git rebase -i.
https://github.com/jbremson/git_koans (work in progress)
~