- 修改author和committer
git filter-branch --commit-filter '
export GIT_AUTHOR_EMAIL=me@example.com;
export GIT_AUTHOR_NAME=me;
export GIT_COMMITTER_EMAIL=me@example.com;
export GIT_COMMITTER_NAME=me;
git commit-tree "$@"
' [commit1..commit2]
- 删除无效的ref
git update-ref -d refs/original/refs/heads/master
- 删除文件
git filter-branch --tree-filter '
git rm -f --ignore-unmatch password.txt
' [commit1..commit2]
网友评论