本地分支迁移至gerrit
在Gerrit创建分支
ssh -p 29418 xxx@xxx.cn gerrit create-branch xxx/xxx new-branch master
在本地分支增加commit-msg钩子
$ scp -p -P 29418 xxx@xxx.cn:hooks/commit-msg “xxx/.git/hooks/”
修改remote_url
Before:
$ cat .git/config |grep xx
url = git@xxx.cn:xxx/xxx.git
After:
$ cat .git/config |grep xx
url = ssh://xxx@xxx.cn:29418/xxx/xxx
commit并推送
git commit --amend --no-edit
git push origin new-branch