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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 07:17:02  来源:igfitidea点击:

git push origin head?

git

提问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 masterwhich returned Everything up-to-date

然后我尝试使用git push origin masterwhich 返回来推送到 masterEverything up-to-date

I typed git push origin headwhich seemed to work although I'm not sure if I'm supposed to do this. Previously git push origin headhad always worked for me.

我输入的git push origin head似乎有效,尽管我不确定是否应该这样做。以前git push origin head一直对我来说有效。

My question is, why would git push origin masternot 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 masterisn't going to do anything because you've asked it to push the masterbranch. 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 pushwithout additional arguments.

...或任何你称之为开发分支的东西。在这样做一次之后,您通常应该能够在git push没有额外参数的情况下运行。