2017-07-17 65 views
-2

无法在本地推“的新文件”到特定的“远程的Git分支”无法将“新文件”推到一个特定的远程的Git分支

  1. 我创建了一个新的文件。
  2. 我可以将新的本地文件推送到名为的主分支
  3. 但我不是能够在新的本地文件推送到其他远程叫testBranch1
  4. 的例外是收到:

致命的:“遥控器/产地/ testBranch1”不似乎是一个git库 致命的:无法从远程存储库中读取*

+0

'git remote show origin'说什么? – Christoph

+0

@Christoph @Christoph我在原来的文章路径中添加了输出,谢谢 – xGIx

回答

1

正确的语法是

git push -u remoteName testBranch1 

您必须提供遥控器的名称或URL。

+0

感谢您的评论,我添加了下面的代码行,但我担心它没有工作,我做错了什么? git push -u https://github.com/BagGianni/Test333.git testBranch1 – xGIx

+0

甚至以下dosnt工作:git push -u https://github.com/BagGianni/Test333.git遥控器/ origin/testBranch1 – xGIx

+1

你已经有了'origin'和URL https://github.com/BagGianni/Test333.git,所以语法是'git push -u origin remotes/origin/testBranch1:testBranch1'(推送一个本地远程追踪分支来命名远程分支)。如果这不起作用:从该远程跟踪创建本地分支并推送它:'git checkout -b --track testBranch1 origin/testBranch1 && git push origin testBranch1'。 – phd