Reputation: 343
I would like to push my first commit on develop branch and then create a clean main or master branch.
Before push my first commit I use this command to create my develop branch from HEAD
git symbolic-ref HEAD refs/heads/develop
When I push my commit on Github only develop branch exists. It is exactly what I want.
But if I create a main branch, the branch is not empty, they are the same files than my develop branch. It is not what I want.
Below a representation of what I want.
main ======> Clean
develop ======> myFirstCommit
Thanks a lot for your help.
Upvotes: 0
Views: 1266
Reputation:
Branches are a file under .git/refs/heads/ that contain a reference to a commit. The branch that .git/HEAD points to moves along if you add new commits. There is nothing like an empty branch. As long as both refs point to the root of the repo, the two branches will always be the same.
Upvotes: 2