Reputation: 485
I encounter an issue when I create a bare repository. Here is my step:
Test
in a C:\
as a remote repositoryC:\Test
git init --bare
in terminalC:\Test
to my local folder D:\Test
However, I can't see master branch in both C:\Test
and D:\Test
. How can I create a master branch? Thanks
PS: my C:\Test
has hooks, info, objects, refs, config, description, HEAD. Do I need to check in them and make them as master branch?
Upvotes: 1
Views: 1338
Reputation: 1327384
As I explained in "Why do I need to explicitly push a new branch?", an initialized repository (bare or not) has 0 branch.
You need, in the non-bare repository D:\Test
, to create, add and commit a file, in order for any branch (here the master branch by default) to be created.
You can see an example here.
Then: git push -u origin
master will update the remote bare repository.
Upvotes: 1