Luke Puplett
Luke Puplett

Reputation: 45273

How to push a locally-create branch

I created a new local branch using the Git GUI. I committed to it. I want to push it so its backed-up.

I just did a git push thinking it'd know what to do. Thinking it would push my branch up and make one on the server.

This Q/A seems to say it should:

How do you create a remote Git branch?

However, I get this error.

! [remote rejected] MyBranchName -> MyBranchName (no such ref)

error: failed to push some refs to 'http_link_not_allowed_by_SO'

Any ideas?

Upvotes: 1

Views: 330

Answers (1)

Luke Puplett
Luke Puplett

Reputation: 45273

It seems the remote repo got corruptified. That's a word. On the server, in refs/heads/ was a folder for the branch, which made it appear that it had gotten so far to pushing and died.

So I renamed it and pushed again and it was fine.

Update

It actually seems that the problem recurs again. It's like I can only push a branch once.

Upvotes: 1

Related Questions