Reputation: 41256
I have an repository in which the master
branch was renamed to product
. Things are fine except on one box where the code was cloned before this change. On that box HEAD
still points to master:
* local-2
remotes/origin/HEAD -> origin/master
remotes/origin/local-1
remotes/origin/product
remotes/origin/local-2
It's certainly incorrect, but in practical application, it's also causing an issue with a deployment script. What would it take to reposition remotes/origin/HEAD
so that it points to remotes/origin/product
?
Upvotes: 1
Views: 191
Reputation:
These lines of output:
remotes/origin/HEAD -> origin/master
remotes/origin/product
say that the reference HEAD
in your origin repo points to origin/master
, but as you've said, origin/master
has been renamed to origin/product
. You'll need to do two things to correct this:
HEAD
on origin
point to product
.remotes/origin/HEAD
point to origin/product
.For step #1, if your origin
is hosted on GitHub, you simply set the default branch for origin
to product
. If it's not hosted on GitHub, you'll need access to the remote repo, from which you run the following:
git symbolic-ref HEAD refs/heads/product
For step #2, you'll need to run the following on each local clone to update what they have the remote repo HEAD
configured to:
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/product
See also:
git symbolic-ref
.Upvotes: 4