git push 失败问题

刚才git push到远端时报错如下:

remote: Hint: To automatically insert Change-Id, install the hook:
remote:   scp -p -P 29418 gerrit@127.0.0.1:hooks/commit-msg `git rev-parse --git-dir`/hooks/commit-msg
remote: git commit --amend

remote: ERROR: missing Change-Id in commit message footer

To ssh://lining@114.215.120.180:8849/activity
 ! [remote rejected] 本地分支名 -> refs/for/远端分支名 (missing Change-Id in commit message footer)
error: failed to push some refs to 'ssh://xxxxx'


git loggit show都显示是对的但push就是失败尝试如下三种方法皆无效且报错不变:

一.

按照提示运行

先$scp -p -P 29418 gerrit@127.0.0.1:hooks/commit-msg `git rev-parse --git-dir`/hooks/commit-msg

然后$git commit --amend

依旧push失败


二.

git commit --amend 然后删除Change-id那一行让系统自动生成

依旧push失败


三.

git reset

然后重新提交

依旧失败




思路:使之等效为另一个问题"如何在本地分支bb上使用本地分支aa的commit"

解决方法如下:

设之前操作的是分支aa

git branch bb 新建分支
git checkout aa 切换到commit成功但是push失败的那个分支
git log 记录下commit id [如commit 7279dd1533ae68e5798f495334e9c07d148102cc]
git checkout bb 切换至bb分支
git log (非必需)
git cherry-pick 7279dd1533ae68e5798f495334e9c07d148102cc
git show (非必需)
git branch -a

git push letv bb:refs/for/远端分支名


成功

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值