tags:

views:

41

answers:

2

I did

git checkout -b foo origin/master
git push origin foo

to create a branch and push it to the remote repo. This is obviously the wrong way to do it (I'm a git beginner). But apart from being wrong, it created a much more serious problem: Now we cannot push to master anymore!

Deleting the new branch ("foo") doesn't help. Cloning a fresh repo doesn't help as well. Another info on a side effect which might help to identify the problem: Unfuddle (a git hosting site, similar to github) shows the newly created branch as HEAD. And after deleting that branch, master is shown as HEAD again, but every other afterwards correctly created branch (git branch foo and git push origin foo) is shown as HEAD again ...

No one can currently push to master, it's not just me.

Google couldn't help so far ... Can you?

Thanks a lot!

Update: This problem has resolved itself by committing something ... But we still don't know what went wrong and would be interested in an explanation. But obviously this has lost its urgency.

To answer your questions:

  • No, there was no error message at all when pushing. It just didn't do it.
  • git ls-remote <remote> only showed what we already knew, that foo was now HEAD.
A: 

You can't push because you only have created a local branch. You need remote as well if that's what you want. You need to create remote branch, and set your local to track it:

git push origin origin:refs/heads/foo
git checkout --track -b foo origin/foo
git push
skrat
The OP is trying to push *master*, not foo.
Jefromi
A: 

If you want to push foo to master you have to do

git push origin foo:master

mb14