[Git] How to use git rebase
晚上10:37
Today, I am survey a git rebase method, then I want practice to change previous commit command.
You can refer follow step to change...
How to change the previous commit:
- Use rebase to edit previous 3 commit
git rebase -i HEAD~3
- Open editor to edit the commit which you want to change
pick f37e150 xxxx
pick f15f439 xxxx
edit 647aab8 xxxx
- amend to your commit
git commit --amend
- After change your commit then continue rebase
git rebase --continue
- Done.
If you suffer follow error as your editor (default is ‘vi’), you can use follow command:
error: There was a problem with the editor 'vi'. Please supply the message using either -m or -F option.
git config --global core.editor /usr/bin/vi
[Reference]
0 意見