tags:

views:

144

answers:

3

Most git repositories have a master branch, but there's really nothing special about this name. You can delete the master branch, rename another branch to master, skip having the master branch altogether.

Is anything in git hardcoded to expect a master branch? If I have a repository that doesn't have a branch with this name, is there anything I can expect to work improperly?

+6  A: 

To my knowledge, nothing at all will break within git. But if you are working with other developers who are used to a master branch, their personal workflows may be broken unless this is clearly communicated to them. Hope this helps!

Adam Alexander
+5  A: 

The problem in a DVCS (as in "Decentralized") is the notion of "convention" which can be more important than for a classical VCS.

Since every user will clone the repository, they might have some script already in place which will parse for a "master" branch (like this build.pl perl script)

Even though you can name or organize your branches with whatever name you want in Subversion (you are not required to have a "trunk" for instance), it might be wise, if you publish your repository, to respect at least this convention.

If this is purely internal development (with internal replication for backup purposes for instance), you can name it whatever you want.

VonC
+6  A: 

You don't have to have a master branch, but you should probably set HEAD to a branch that exists even on a bare repository. HEAD is used to determine which branch to checkout by default by git clone.

Charles Bailey