Skip to content

Instantly share code, notes, and snippets.

@elrrrrrrr
Last active August 29, 2015 14:10
Show Gist options
  • Select an option

  • Save elrrrrrrr/d191f48d67e60a65e878 to your computer and use it in GitHub Desktop.

Select an option

Save elrrrrrrr/d191f48d67e60a65e878 to your computer and use it in GitHub Desktop.
git commit
//修改提交过的commit author 例如提交纪录 A-B-C-D-E 修改C D author
//rebase至 前一个commit 即B
git rebase -i B
//将B和C的action写成eidt或者e
//rebase会执行至C,所以可以修改C的author
git commit --amend --author="Author Name <email address>"
git rebase --continue
//接着就会执行到D
git commit --amend --author="Author Name <email address>"
git rebase --continue
//结束
//合并多个commit提交信息 例如提交纪录 A-B-C-D-E
//rebase至 前一个commit 即B
git rebase -i B
//将B的action写成splash或者s
git rebase --continue
git reflog
git cherry-pick <hash>
git filter-branch --tree-filter "rm -rf node_modules"
git push --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment