3

I had made some changes to a file under a git repo, I committed the files using git commit

I then tried to push to master using git push origin master which returned Everything 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.

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?

Allan Thomas
  • 3,481
  • 5
  • 26
  • 29
  • Are you working in the local master branch or a branch tracking master? Is the remote repo using master as the main branch (the actually selected branch when you clone)? – Ricardo Souza Jul 31 '12 at 00:09
  • I'm trying to work from a dev branch on my local and live branch on the public-facing server – Allan Thomas Jul 31 '12 at 00:28

1 Answers1

1

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 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.

larsks
  • 277,717
  • 41
  • 399
  • 399
  • 1
    *“`git push origin master` isn't going to do anything”* – Not true. It should push to the remote’s master. – poke Jul 31 '12 at 09:25
  • ...not if he's been working on a development branch and left the master branch unmodified. – larsks Jul 31 '12 at 10:39