Your Branch
Last updated
Was this helpful?
Last updated
Was this helpful?
By default Git will create a branch called master when you create a new repository with git init
. From Git version 2.28 onwards, you can set a different name for the initial branch.
To set main as the default branch name do:
Checking Your Settings :
If you want to check your configuration settings, you can use the git config --list command to list all the settings Git can find at that point:
You may see keys more than once, because Git reads the same key from different files ([path]/etc/gitconfig
and ~/.gitconfig
, for example). In this case, Git uses the last value for each unique key it sees.
You can also check what Git thinks a specific key’s value is by typing git config <key>
:
Since Git might read the same configuration variable value from more than one file, it’s possible that you have an unexpected value for one of these values and you don’t know why. In cases like that, you can query Git as to the origin for that value, and it will tell you which configuration file had the final say in setting that value: