赞
踩
使用Gerrit时候提交不成功,提示没有权限。
remote: ERROR: commit 00036e1: missing Change-Id in message footer
remote: Hint: to automatically insert a Change-Id,install the hook:
remote: gitdir=$(git rev-parse --git-dir); scp -p -P 28110 username@127.0.0.1:hooks/commit-msg ${gitdir}/hooks/
remote: and then amend the commit:
remote: git commit --amend --noedit
remote: Finally, push your changes again
之前一直使用GitLab,所以每次都是手动创建合并请求,而 Gerrit 可以通过这种方式自动创建合并请求
1.重新拉去仓库到本地,执行完整的代码
git clone "ssh://username@127.0.0.1:2811/repo" && scp -p -P 2811 username@127.0.0.1:hooks/commit-msg "go-server/.git/hooks/"
2.递交的时候先commit到本地分支再
git commit -m "备注内容"
git push origin HEAD:refs/for/develop
git push origin HEAD:refs/for/v1.0.10
develop 是你要递交的分支,提交成功后,Gerrit 会默认在上面创建合并请求。
Enumerating objects: 19, done.
Counting objects: 100% (19/19), done.
Delta compression using up to 12 threads
Compressing objects: 100% (10/10), done.
Writing objects: 100% (11/11), 7.44 KiB | 3.72 MiB/s, done.
Total 11 (delta 7), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (7/7)
remote: Processing changes: refs: 1, new: 1, done
remote:
remote: SUCCESS
remote:
remote: http://127.0.0.1/c/repo/+/1671 提交的备注内容 [NEW]
remote:
To ssh://127.0.0.1:2811/repo
* [new branch] HEAD -> refs/for/dev
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。