【问题标题】:Can you push codes from one branch to another, a different downstream to a different upstream [duplicate]您可以将代码从一个分支推送到另一个分支,将不同的下游推送到不同的上游[重复]
【发布时间】:2021-07-27 16:42:07
【问题描述】:

我正在本地机器上的不同分支上工作,但我想将代码推送到上游的不同分支。如何才能做到这一点。我正在尝试推动 nicholas-dev
这是我收到的错误消息

C:\Users\njoca\Documents\BoTest\boegisexternal (dev-samuel -> origin)
λ git push nicholas-dev
fatal: 'nicholas-dev' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

【问题讨论】:

    标签: git gitlab


    【解决方案1】:

    你需要使用:

    git push origin dev-samuel:nicholas-dev
    

    其中origin 是远程的名称,dev-samuel 是本地分支的名称,nicholas-dev 是远程分支的名称。

    【讨论】:

    • 谢谢,这表明我将代码推送到了分支,但我在分支上看不到我的提交或代码
    • @Joca 无法说出这些信息到底发生了什么。
    猜你喜欢
    • 2016-06-26
    • 2021-10-11
    • 2014-11-08
    • 2015-01-01
    • 2012-12-03
    • 2019-02-02
    • 2020-02-20
    • 2020-06-09
    相关资源
    最近更新 更多