遇到的问题multipleAuthors:
$ git push -u origin master
Enumerating objects: 296763, done.
Counting objects: 100% (296763/296763), done.
Delta compression using up to 8 threads
Compressing objects: 100% (56698/56698), done.
remote: error: object 487128950df6ee433c131b5feaafe81ee86629f4: multipleAuthors: invalid format - multiple 'author' lines
remote: fatal: Error in object
fatal: sha1 file '<stdout>' write error: Broken pipe
error: remote unpack failed: index-pack abnormal exit
完整解决思路:
# github项目克隆到本地
git clone xxx
# 所有远程分支拉到本地
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
# 强制把所有作者改为同一个名字
git filter-branch -f --env-filter "GIT_AUTHOR_NAME=admin_op" -- --all
# 把本地项目推送到gitlab
git remote rename origin old-origin
git remote add origin https://yyyy.git
git push -u origin --all
git push -u origin --tags