//gerrit 提交命令
git push origin branch-name:refs/for/branch-name
//生成change-id,先将gerrit的commit-msg 拷到本地的 .git/hooks下面。
scp -p -P 29418 username@gerrit.example.com.cn:hooks/commit-msg .git/hooks/
git commit --amend
git 提交缺失changeId
https://www.jianshu.com/p/1848fabc9360
使用Git提交代码时,遇到missing Change-Id in commit message footer
会在提交失败信息中提示如何操作,缺失change-Id 会出现如下提示信息,Hint: To automatically insert Change-Id, install the hook:
gitdir=$(git rev-parse --git-dir); scp -p -P 29418 name@git.co.com:hooks/commit-msg ${gitdir}/hooks/
按照提示执行 gitdir....命令然后重新commit 和 push 就可以
git commit --amend //不需要修改都行 直接退出即可
git push origin
///
git rev-parse命令
git rev-parse --git-dir | 显示版本库.git目录所在位置 |
git rev-parse --show-toplevel | 显示工作区根目录 |
git rev-parse --show-prefix | 所在目录相对于工作区根目录的相对目录 |
git rev-parse --show-cdup | 显示从当前目录后退到工作区的根的身度 |