git create branch without initial commit 1

git create branch without initial commit

git checkout --orphan 
git commit

Here is what the above code is Doing:
1. git checkout –orphan
– This creates a new branch with no parents.
– This is the branch you will use to commit your new files.
2. git commit
– This commits your new files to the new branch.

Similar Posts