美文网首页
Git之filter-branch

Git之filter-branch

作者: 寂寞的原子 | 来源:发表于2015-07-23 17:35 被阅读971次
  • 修改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]

相关文章

网友评论

      本文标题:Git之filter-branch

      本文链接:https://www.haomeiwen.com/subject/ehtmqttx.html