git rebase -i HEAD~[합칠 커밋 개수]
git rebase -i HEAD~2
$ git rebase -i HEAD~2
pick 004644d first commit // 처음 올린 커밋에
pick ae53bdf second commit // 두번째 올린 커밋을 합치고 싶은 경우
# Rebase f42adb4..ae53bdf onto f42adb4 (2 commands)
#
# 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
# d, drop = remove commit
#
# 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
$ git rebase -i HEAD~2
pick 004644d first commit
s ae53bdf second commit // squash로 합친 다는 뜻
# Rebase f42adb4..ae53bdf onto f42adb4 (2 commands)
#
# 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
# d, drop = remove commit
#
# 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
git push -f origin [브랜치명]