Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法推送';新文件&x27;到特定的远程Git分支_Git_Github - Fatal编程技术网

无法推送';新文件&x27;到特定的远程Git分支

无法推送';新文件&x27;到特定的远程Git分支,git,github,Git,Github,无法将“新文件”推送到特定的“远程Git分支” 我在本地创建了一个新文件 我能够将新的本地文件推送到名为master的远程分支 但是,我无法将新的本地文件推送到另一个名为testBranch1 收到的例外情况: 致命:“remotes/origin/testBranch1”似乎不是git存储库 致命:无法从远程存储库读取。*正确的语法为 git push -u remoteName testBranch1 你必须给出remote的名称或URL。git remote显示源代码的意思是什么?@Ch

无法将“新文件”推送到特定的“远程Git分支”

  • 我在本地创建了一个新文件
  • 我能够将新的本地文件推送到名为master的远程分支
  • 但是,我无法将新的本地文件推送到另一个名为testBranch1
  • 收到的例外情况:
  • 致命:“remotes/origin/testBranch1”似乎不是git存储库 致命:无法从远程存储库读取。*

    正确的语法为

    git push -u remoteName testBranch1
    

    你必须给出remote的名称或URL。

    git remote显示源代码的意思是什么?@Christoph我已经在我原来的帖子中添加了输出,谢谢Hanks的评论,我添加了以下代码行,但恐怕没有用,我做错了什么吗?git push-u testBranch1甚至以下操作也可以:git push-u remotes/origin/testBranch1您已经有了带有URL的
    origin
    ,因此语法是
    git push-u origin remotes/origin/testBranch1:testBranch1
    (将本地远程跟踪分支推送到指定的远程分支)。如果不起作用:从远程跟踪创建一个本地分支并推送它:
    git checkout-b——跟踪testBranch1 origin/testBranch1&&git推送origin testBranch1