git/gerrit 常用命令记载

//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显示从当前目录后退到工作区的根的身度

 

 

 

 

 

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值