0

I want to move a branch to its own repository. I tried following this. I initialize an empty repository:

git init --bare

I can then push to that repository. However, if I try to clone/fetch/pull it, it does not work because there is no master, and HEAD is not set.

If I run:

git remote show origin

It does not show any branches. I tried doing

git push <new_repo> <branch>:master

But this also does not work. It complains that refspec does not match.

Community
  • 1
  • 1
user110971
  • 153
  • 7

1 Answers1

0

So, I solved my own problem. You need to do it in two steps. Firstly, push to a repo initialized with:

git init

Then push to a remote initialized with:

git init --bare
user110971
  • 153
  • 7