問題:
有以下commit:
323udd
ede234
6e7s6e
要合並第一個和第二個commit
方法有二:
方法一
使用git rebase -i hash-id,-i表示以交互模式進行commit合並,hash-id指代某個commit,如
git rebase -i 6e7s6e (這步操作會多出彈出交互窗口進行commit的設置)
方法二
使用git reset --soft hash-id,如下操作:
git reset --soft 6e7s6e
git commit -m "merge 323udd and ede234"