I have a private server running git 1.7
When I
git init
a folder it doesn’t create a master branch.
Cause when i do:
git branch
it doesn’t list anything.
When I do:
git --bare init
it creates the files.
When I type
git branch master
it says:
fatal: Not a valid object name: 'master'.
This is true, and expected behaviour. Git will not create a
masterbranch until you commit something.A non-bare
git initwill also create the same files, in a hidden.gitdirectory in the root of your project.That is again correct behaviour. Until you commit, there is no master branch.
You haven’t asked a question, but I’ll answer the question I assumed you mean to ask. Add one or more files to your directory, and
git addthem to prepare a commit. Thengit committo create your initial commit andmasterbranch.