【问题标题】:git push command for pushing a local commit to a different remote branchgit push 命令用于将本地提交推送到不同的远程分支
【发布时间】:2013-08-01 17:04:02
【问题描述】:

我同步到分支“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'

【问题讨论】:

    标签: android git repository


    【解决方案1】:

    我能够更多地使用它并找到更好的解决方案。如果我没看错,远程分支“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
    

    【讨论】:

    • 唷...对代码进行了一些斗争,但我相信现在这两种情况下都能正常工作。
    猜你喜欢
    • 2013-04-08
    • 2011-03-13
    • 1970-01-01
    • 2020-02-05
    • 1970-01-01
    • 2016-10-25
    • 2015-07-24
    • 2013-04-10
    • 2016-01-04
    相关资源
    最近更新 更多