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?
Master and branch makes no difference for git. So you can use git without a master.
If your first (default) branch is not named "master", the remote/origin/HEAD doesn't seem to be set. Steps to reproduce : Create a new project. Prepare your local repo : git init, add your files, commit locally and add your origin.
Not committing to master prevents colliding commits and having to merge each time 2 people change the same file.
It's the first branch to be created automatically when you create a new repository. By default, this initial branch is named master .
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
.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With