更改 git 提交记录里的名字和邮箱

更改名字和邮箱(作者和提交者):

git filter-branch -f --commit-filter 'if [ "$GIT_AUTHOR_NAME" = "xxxxxxxx" ];then GIT_AUTHOR_NAME="yyyyyy";GIT_AUTHOR_EMAIL="[email protected]";GIT_COMMITTER_NAME="yyyyyy";GIT_COMMITTER_EMAIL="[email protected]";git commit-tree "$@";else git commit-tree "$@";fi' HEAD

git filter-branch 会生成备份,可以删除:
删除某个分支备份:

git update-ref -d refs/original/refs/heads/分支

或者(删除所有备份):

git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d

 

一些Git学习资料

前言:

Git是啥:http://zh.wikipedia.org/wiki/Git

 

不知不觉看了一堆资料,都是很不错的(除了注明英文的其余均为中文):

Pro Git:http://progit.org/book/zh/

Git Community Book:http://gitbook.liuhui998.com/

 

Git 故事连载:http://gitstory.wordpress.com/

Git 中文教程:http://www.linuxsir.org/main/doc/git/gittutorcn.htm

Why Git is Better than X:http://zh-cn.whygitisbetterthanx.com/

理解Git工作流:http://heikezhi.com/2011/08/04/understanding-the-git-workflow/

GIT分支管理是一门艺术:http://roclinux.cn/?p=2129

Git开发管理之道:http://blog.leezhong.com/translate/2010/10/30/a-successful-git-branch.html

git多人协作开发流程(以blog为例):

http://blog.leezhong.com/tech/2011/02/25/git-workflow-with-blog-demo.html

[英]A few git tips you didn’t know about:http://mislav.uniqpath.com/2010/07/git-tips/

构造干净的 Git 历史线索:http://codecampo.com/topics/379

GotGitHub:http://www.worldhello.net/gotgithub/index.html

Git Immersion:http://gitimmersion.googol.im/