0

This question:

How to push a locally-create branch

Received a +1 comment:

It looks like the remote repository has been configured not to allow you to push new branches.

Now, I created the remote repository using this ASP.NET project:

http://www.jeremyskinner.co.uk/2010/06/25/hosting-a-git-server-under-iis7-on-windows/

So, how do configure the remote repository to accept new branches? For the record, I can't imagine Jeremy's code does anything to disable pushing branches.

The remote repo has otherwise been working perfectly until I tried to push a branch created locally.

Update 1

  • The remote repo has bare = true in the config file.
  • There is also a folder with my branch name in it in the server refs\heads folder so it must have pushed something.

Luke

Community
  • 1
  • 1
Luke Puplett
  • 42,091
  • 47
  • 181
  • 266
  • what error do you receive? Is your remote repository a bare repo? (You can find this by running `git config core.bare`). Notice that you are not allowed to push into a non bare repository. – niculare Mar 29 '13 at 09:29
  • The repo has only logs, objects, refs, config and HEAD folders. It doesn't look like a normal repo. Running `git status` says `fatal: This operation must be run in a work tree` – Luke Puplett Mar 29 '13 at 11:22
  • @niculare Okay, I have bare = true in the config on the server. – Luke Puplett Mar 29 '13 at 11:27

2 Answers2

1

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.

Luke Puplett
  • 42,091
  • 47
  • 181
  • 266
0

Another reason for this (for reference, not an answer!) is that the remote repository is handled by e.g. gitolite, which does allow fine-grained control over what remote users are allowed to do. Plain git repositories can't be configured to disallow accesses AFAIK. Either you have full read/write access, or none. The only way to restrict writing is to use file/directory permissions.

vonbrand
  • 11,412
  • 8
  • 32
  • 52