I’m trying to establish workflows for creating new projects and for setting old projects to be version controlled through Git. It is finally all making sense, except for one step. When I create a new project, initialize Git in it and do an initial commit I then do a git clone --bare ./myproject //myserver/myshare/myproject.git. I then set up a remote, git remote add origin //myserver/myshare/myproject.git. These seem to work fine. But, when I do git branch -a, it does not show there being a master branch on the remote.
The way I am getting around this right now is, I just git clone //myserver/myshare/myproject.git to a different location and the remote is already set up, and the master branch is present on the remote. I have no idea what could be wrong, especially since the only difference it seems is which way the remote is set up.
Thanks in advance!
Nothing is wrong. From the
git cloneman page:Bare repositories don’t map the
mastercommit pointer torefs/remotes/origin/master, but they don’t have to. Bare repos are vital when setting up remotes that others mightpushto orpullfrom, but they aren’t where you do day-to-day dev work. It sounds like you have anorigin. Unless you’re setting up another remote, stick withgit clone //myserver/myshare/myproject.gitfor your local repository.