I have cloned an empty repository. I have an empty master branch. I need to branch out to a dev branch and start my development code there. Later I might not even need the master branch but some stable branch to keep my stable code.
When I use git branch dev it says fatal: not a valid object ‘master’.
But when I commit a file inside the master it allows me to branch out.
To have a branch, git requires you to have at least one commit, then it will create the master branch from its reference.
If you are going to delete
masterafterwards, and you already have multiple branches, you must:Doing this will update the
HEADreference to point toyour_chosen_branch. Otherwise you’ll have to do this manually: