当前位置:  开发笔记 > 运维 > 正文

Git推不工作但git pull在远程分支上

如何解决《Git推不工作但gitpull在远程分支上》经验,为你挑选了1个好方法。

我团队中的一位开发人员遇到了以下问题.他们有能力拉出一个远程分支,说它是最新的,但他们无法推送到那个远程分支.以下是他们在Windows git命令提示符中获得的内容

MY@MY-PC ~/documents/workspace/my-repository (workflowNewCOBRequest1)
$ git remote show origin workflowNewCOBRequest1
Enter passphrase for key '/c/Users/MY/.ssh/id_rsa':
* remote origin
  Fetch URL: git@github.com:myorg/my-repository.git
  Push  URL: git@github.com:myorg/my-repository.git
  HEAD branch: master
  Remote branches:
    2_Initial_COB_Submission tracked
    COB_VF_email_template    new (next fetch will store in remotes/origin)
    Team-approval            tracked
    develop                  tracked
    master                   tracked
    testing                  tracked
    workflowNewCOBRequest1   tracked
  Local branches configured for 'git pull':
    develop                merges with remote develop
    master                 merges with remote master
    workflowNewCOBRequest1 merges with remote workflowNewCOBRequest1
  Local refs configured for 'git push':
    Team-approval pushes to Team-approval (up to date)
    develop       pushes to develop       (local out of date)
    master        pushes to master        (up to date)

MY@MY-PC ~/documents/workspace/my-repository (workflowNewCOBRequest1)
$ git push origin workflowNewCOBRequest1
Enter passphrase for key '/c/Users/MY/.ssh/id_rsa':
fatal: workflowNewCOBRequest1 cannot be resolved to branch.
fatal: The remote end hung up unexpectedly

我搜索过互联网,找不到类似的东西.有任何想法吗?

谢谢

保罗



1> Daniel Ellio..:

我使用旧版本的git遇到了类似的问题

尝试

git version

并与没有问题的人比较

虽然,在这里看起来问题是你没有本地REF将该分支推回到原点.

这有用吗?它明确指出要推送到(和)的分支

git push origin workflowNewCOBRequest1:workflowNewCOBRequest1

推荐阅读
重庆制造漫画社
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有