When I create a new branch and push it to my git repo, the new branch is lined up with master branch because I did not make any changes. This is how I did it.
git checkout -b newbranch
git push -u origin newbranch
I want to create a branch with a commit so that others can see a commit message that a branch was created. But, I do not want to make any changes in this commit. Basically, my new branch should be ahead of master by 1 but files are identical with those in master.
How can I do this? I tried git commit -m "created branch newbranch"
before the git push
, but git told me that there is nothing to commit.