0

I have a branch I want to rename as master. I have been working on, branching from, and creating pull requests from this branch. My current master is broken as it somehow has a different history than the repo I forked from. I tried cloning into a different folder and the same problem persists.

I wish to keep the history of the branch I have been working from as well as all of the branches I created from it. I can completely wipe out the current master and completely replace its history. I have found this and this resource, but I am unsure as to what happens to the history of the branches once you switch. Also I am the only one who has been working on this remote.

afriedman111
  • 1,925
  • 4
  • 25
  • 42

1 Answers1

0

Keep in mind that branches in git are just pointers to revisions, that you can shuffle around at will so keep the old broken master and then rename your branch as master, no problem with that

git checkout master
git branch -m broken-master
git checkout the-other-branch
git branch -m master
eftshift0
  • 26,375
  • 3
  • 36
  • 60