Reputation: 12636
I was attempting to copy foo
repo into new fooBar
repo. I am running into an error, here is what I did:
fooBar
foo
folder (the repo I wanted to copy) in same dir as foo
locally.foo(Copy)
to fooBar
locally. cd fooBar
and ran git remote rm origin
as per How to remove origin from git repository (which might have been a mistake, because I am just using github, not git-svn)fooBar
repo like so:
git remote add origin https://github.com/myteam/fooRepo.git
git push -u origin development
(Note that I used development
instead of master
- I thought master
doesn't have any significance and is just a convention)fooBar
folder once I saw it has pushed to github successfully. I then tried pulling it
git clone https://github.com/myAccount/fooBar.git
I then get the following:
Cloning into 'fooBar'...
remote: Counting objects: 9297, done.
remote: Compressing objects: 100% (1727/1727), done.
remote: Total 9297 (delta 7542), reused 9297 (delta 7542), pack-reu
Receiving objects: 100% (9297/9297), 1.58 MiB | 253.00 KiB/s, done.
Resolving deltas: 100% (7542/7542), done.
warning: remote HEAD refers to nonexistent ref, unable to checkout.
I can't find an answer for the highlighted error when cloning - everyone seems to have a problem when deleting a remote branch and trying to pull it.
warning: remote HEAD refers to nonexistent ref, unable to checkout.
Note, in my new fooBar
repo, development
is the only branch and it's set Default
.
Upvotes: 2
Views: 4079
Reputation: 24136
While cloning a repo default branch is master
. But your master
is bare (no working or checked out copy of your source files
). All the codes are in development
branch.
So, you need to mention development
branch while cloning. Or, you need to push a master
branch.
Try this:
$ git clone https://github.com/myAccount/fooBar.git --branch development
Or,
$ git clone https://github.com/myAccount/fooBar.git --branch development -b development --single-branch
Upvotes: 5