As long as you have some branch pointing to the point or points in history that you want to preserve, you don’t have to worry about losing information. That is one of the awesome things about Git. And even if you mess up, the information is still in your repository, but it is harder to re-establish a branch when you don’t have a pointer.
It sounds like what you want is:
- Branch before_hbase to become master
- Branch master to become hbase
- Branch MapR to become mapr
If my above understanding is correct, then this is what I would recommend. Warning: while none of these actions are destructive, making changes of this type might make it hard to recover from if something goes wrong. Therefore, I strongly recommend having a backup of your Git repository (not just the files inside it) somewhere else while you’re making these changes.
From the root of your repository:
git checkout master
git checkout -b hbase
git branch -D master
git checkout before_hbase
git checkout -b master
git checkout MapR
git checkout -b mapr
And then you’re done!
Notice, the only branch we deleted was the original master and that was only after we had created hbase to point to it. Because Git branches are simply pointers to a point in the Git history graph, we can mostly just create new branches and not worry about deleting the old ones until we’re sure we don’t need them anymore. The only one we needed to delete was the one whose name we wanted to reuse 😀
I hope that helps!