We would like to enforce a new policy for our projects that the master branch now be called the release branch to ensure it is more clear as to how the branch should be used. Naturally, we will have develop and release candidate branches as well.
I understand I can rename the master branch locally by simply using the following:
git branch -m master release
However, that is only locally. Even if I push this up to the remote, the HEAD still points to the remote master branch. I want to get rid of the master branch completely and make the default local branch upon initial clone, be release.
How can I achieve this?
EDIT: It seems that since the origin is on a gitorious server, I get errors deleting the master branch. I'm trying to see now if it is possible to change this so that the default branch is 'release'.
Heh, fair enough. Long term worth is high enough to at least try.
Possible duplicate of How do I rename a local Git branch?
When I attempt git push --delete, I get the following error: deletion of the current branch prohibited
You are using github or something similar, you need to make the default branch something else: matthew-brett.github.com/pydagogue/gh_delete_master.html or just leave master there and ignore it.
Yeah, we have a gitorious instance. Let me see if that is an option.
It looks like gitorious' commit hooks forbid the deletion of the master branch -- for no good reason that I can see :/
bah! Well, then perhaps I will just have to ignore the master branch or simply use the name "master" and know that it is the release branch. I wonder if there is a way to at least tell gitorious to make the release branch a default if we went that route. I know we are eventually moving to an enterprise license for github, but not there yet.
I can tell by these steps I will run into the same error as I mentioned above.
KyleHayes That's a configuration issue of the server. Though it is this way by default, the process to alter that should either be apparent to the user or easily discoverable on Stackoverflow
I got the same error as the one I posted in Adam's comment when I got to the git push origin :master command.