In a group-shared Git repo, I had this repo structure:
o---o---o---o branch2
/
o---o---o---o---o master
\
o---o---o branch1
After aligning it with git flow approach, it became this:
o---o---o---o maintenance/branch2
/ c1
o---o---o---o---o develop
\ \
\ o---o---o master
\
o---o---o maintenance/branch1
So, the 3 branches were renamed:
- branch1 -> maintenance/branch1
- branch2 -> maintenance/branch2
- master -> develop
And a new branch master
was created from commit c1
.
Changes were pushed on remote and pulled (with prune) on all clients.
Everything was fine, but after some time, after a fetch, the master
tip on remote "moves" back to the old tip (same as develop
).
I have done (locally and on remote):
git gc --prune="0 days"
git gc --prune=now
git fsck --full
Then, I again delete master
from remote, push my local master
(created from c1
) and everything looks good. I even do a clone to new folder and it comes correctly -- showing new branch structure.
But after some hours/day, master
is again "reverted" on the remote!
Remote git reflog
shows absolutely nothing (as there were no pushes in the meantime and gc was run a day ago).
Any ideas why the branch keeps moving its tip on the remote?
NB. remote HEAD
points to develop
.
NB2. this is how I renamed the branches:
git checkout ${ori}
git branch -m ${ori} ${new}
git push origin :${ori}
git push --set-upstream origin ${new}