我可以用一只手来学习如何将本地分支推送到远程分支。请看下面。帮助非常感谢!

克隆仓库后创建本地分支,然后执行

$ git checkout -b mybranch remotes/origin/mybranch

$ git branch -a
  master
* mybranch
  remotes/origin/HEAD -> origin/master
  remotes/origin/master
  remotes/origin/mybranch

但是,当尝试将更改推回备份时:
$ git push mybranch mybranch
fatal: 'mybranch' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

$ git push remotes/origin/mybranch mybranch
fatal: 'mybranch' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

$ git push origin/mybranch mybranch
fatal: 'mybranch' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

最佳答案

尝试

git push origin mybranch

这会将名为的分支mybranch 推送到名为的远程起源

09-04 18:03