繁体   English   中英

git push命令,用于将本地提交推送到其他远程分支

[英]git push command for pushing a local commit to a different remote branch

我同步到一个回购树,它是分支“ jb” ...我在该分支上有一个本地提交,我试图将其推送到一个远程分支“ jb_mr2”并遇到以下错误..是否有一个git push命令我可以用来将此本地提交推送到“ jb_mr2”

terminal3{73}> git push ssh://company.com:29418/platform/vendor/com-proprietary/ship/ftm 72bc75e409e50dcad29bd790b4b6478dc6668f12:refs/for/jb_mr2
Counting objects: 9, done.
Delta compression using up to 32 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 7.01 KiB, done.
Total 6 (delta 3), reused 0 (delta 0)
remote: Resolving deltas: 100% (3/3)
remote: Processing changes: refs: 1, done   
To ssh://company.com:29418/platform/vendor/com-proprietary/ship/ftm
 ! [remote rejected] 72bc75e409e50dcad29bd790b4b6478dc6668f12 -> refs/for/jb_mr2 (branch jb_mr2 not found)
error: failed to push some refs to 'ssh://company.com:29418/platform/vendor/com-proprietary/ship/ftm'

我可以多玩一点,并且有更好的解决方案。 如果我没看错,则远程分支“ jb_mr2”已经存在。 从具有提交的本地分支运行此命令:

git push ssh://company.com:29418/platform/vendor/com-proprietary/ship/ftm 72bc75e409e50dcad29bd790b4b6478dc6668f12:jb_mr2

如果遥控器不存在:

git push ssh://company.com:29418/platform/vendor/com-proprietary/ship/ftm 72bc75e409e50dcad29bd790b4b6478dc6668f12:/refs/heads/jb_mr2

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM