# git clone repo
# cd repo
# git checkout -b new_feature
# なにかをする。
# git commit -m "add new function"
# git push origin new_feature
####作業中にもmasterは変化する。 # git remote add upstream git://hogehoge
# git pull upstream master
# git rebase master
# なおす。
# git add .
# git rebase --continue
# git rebase -i HEAD~n
エディタに以下のようなぶんが出てくる。
pick 0000000 commit message1
pick 0000001 commit message2
pick 0000002 commit message3
ここでは、commitをまとめたり、commit messageの編集、 まとめるcommit まとめない commit の選択、 順序の入れ替えができる。今回はまとめるだけ。
pick 0000000 commit message1
fixup 0000001 commit message2
fixup 0000002 commit message3
こうすれば 0000000 のコミットにまとめられる。