0

I have a local repo for a website I am helping make. I edited some element of the page and I wanted to push the change. The leader of the site project told me to make a new branch, e.g enhancements/pagename, commit the changes I made to this branch, and push the commits.

However, when I push this, it is also pushing earlier commits from the master branch. How do I get git to only push the one commit I have made on the branch?

I am using git checkout -b branchname to create the branch.

Hydrolox
  • 1
  • 3
  • The first time you push that branch the status messages being reported might indicate that you're pushing more commits, that's because it is the first time you push to that branch. – Lasse V. Karlsen Nov 30 '21 at 13:23
  • https://stackoverflow.com/search?q=%5Bgit-branch%5D+new+no+commit – phd Nov 30 '21 at 13:47
  • @LasseV.Karlsen No, the OP's problem is that `git checkout -b` creates a new branch pointing to the head of the current branch, which is `master` for the OP. – phd Nov 30 '21 at 13:49

0 Answers0