git push origin 头?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11731414/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
git push origin head?
提问by Allan Thomas
I had made some changes to a file under a git repo, I committed the files using git commit
我对 git repo 下的文件进行了一些更改,我使用了这些文件 git commit
I then tried to push to master using git push origin master
which returned Everything up-to-date
然后我尝试使用git push origin master
which 返回来推送到 masterEverything up-to-date
I typed git push origin head
which seemed to work although I'm not sure if I'm supposed to do this. Previously git push origin head
had always worked for me.
我输入的git push origin head
似乎有效,尽管我不确定是否应该这样做。以前git push origin head
一直对我来说有效。
My question is, why would git push origin master
not do anything and should I roll back and re-commit, then git push origin master
?
我的问题是,为什么git push origin master
不做任何事情,然后我应该回滚并重新提交git push origin master
?
采纳答案by larsks
If you're working on a development branch, then git push origin master
isn't going to do anything because you've asked it to push the master
branch. If you want to push your development branch, you need to run:
如果您正在开发分支上工作,则git push origin master
不会执行任何操作,因为您已要求它推送该master
分支。如果你想推送你的开发分支,你需要运行:
git push origin development
...or whatever you've called your development branch. And after doing that once, you should generally be able to run git push
without additional arguments.
...或任何你称之为开发分支的东西。在这样做一次之后,您通常应该能够在git push
没有额外参数的情况下运行。