作者热门文章
- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我在 github.com 有一个公共(public)存储库,有 2 个分支:master
和 test
。
我在本地创建了一个新目录并做了:
[ ] git clone git@github.com:{username}/{projectname}.git
然后我创建了一个名为 my_test
的新分支
[ ] git branch my_test
然后切换到它。
[ ] git checkout my_test
然后我将它从我的公共(public)存储库的 test
分支与
[ ] git merge origin/test
这导致了快进。
我做了一些更改并提交了它们。然后我尝试使用
将本地my_test
分支推送到 github 上的公共(public)
test
分支
[ ] git push git@github.com:{username}/{projectname}.git test
但是我得到了这个错误:
error: src refspec test does not match any.
fatal: The remote end hung up unexpectedly
error: failed to push some refs to 'git@github.com:{username}/{projectname}.git
我做错了什么?
最佳答案
也许试试:
git push git@github.com:{username}/{projectname}.git HEAD:test
该命令行上最后一个参数的格式是 refspec,即源引用后跟冒号,然后是目标引用。您还可以使用本地分支名称 (my_test
) 而不是 HEAD 来确定您推送的是正确的分支。
git push
的文档有关于此参数的更多详细信息。
关于git - "git push"到github时报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/959477/
我无法在附加行中显示“真”、“假”、"is"和“否”按钮。 我在这里有一个应用程序:Application 请按照以下步骤使用应用程序: 1。当你打开应用程序时,你会看到一个绿色的加号按钮,点击 在此
我是一名优秀的程序员,十分优秀!