Thursday, February 03, 2011
Creating a bare git repo and avoiding the no master branch problem
I was creating a bare git repo today that would serve as the pristine copy that all others would clone from.
I was doing something like:
- umask 0000 # Because I wanted the pristine copy to be world writable
- git init --bare --shared=all ~/reponame.git
- cd somewhere
- git clone ~/reponame
- cd reponame
- touch foo
- git add foo
- git commit -m test foo
- git push
No refs in common and none specified; doing nothing.What I had to do was at that last step was
Perhaps you should specify a branch such as 'master'.
fatal: The remote end hung up unexpectedly
error: failed to push some refs to '/path/to/reponame.git
- git push origin master