is it possible to perform a first commit on a new repository using a different branch name than "master" ? Thank you
In order to create a Git branch from a commit, use the “git checkout” command with the “-b” option and specify the branch name as well as the commit to create your branch from. Alternatively, you can use the “git branch” command with the branch name and the commit SHA for the new branch.
Usually the first commit is named "Initial commit". As best practice its include a README file describing the project. The README is usually is a md file. You can put any code you wish as well.
Yes, two branches can point to the same commits.
Yes. Before you make any commit you can just do git symbolic-ref HEAD refs/heads/not-master
. This changes the name of the branch that you are on (that has no commits).
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