I accidentally manage to create a completely detached branch in the beginning of the project, and I would like to completely remove it, both from the local and the server repositories.
I am not sure how this happens, but I think the process went something like this:
- I created an empty repository on our git-server (via the web interface). I think it is running gitlab, but it may be some other open source server.
- One of my collaborators made commits to his own branch and pushed them.
- I then made commits to master and pushed them.
Probably I did something stupid when pushing without first pulling or something. Most likely I forced something as well, but it was quite a long time ago so I cannot remember exactly.
I have attached a screenshot from Sourcetree where the first commits in each branch is seen. The blue branch (named something else) is the main branch we have been working on. The red one (called master) is completely useless.
My question is, how can I completely remove the master branch? Preferably I would like to actually delete the commit (it is just nonsense). Also, I would like to be able to rename our current branch to "master".
Is there a way to do this?