Git rewrite commit instructions

Git git git git git git git git git git git git

git commit --amend
Copy the code

If the command does not contain any parameter, the page for editing instructions is displayed. If the command contains the parameter -m, follow the description to be modified.

Git rewrite history commit notes

If you want to change the description of a historical commit, Git can easily do this, but you need to change the base.

git rebase -i <commit-id>^
Copy the code

Commit -id You can view the brief commit-id command:

git log --oneline -n
Copy the code

Note: This -n should be used with a specific number, such as -5 to view the last five submissions