I just made changes to a branch. How can I commit the changes to the other branch?
I am trying to use:
git checkout "the commmit to the changed branch" -b "the other branch"
However, I don’t think this is the right thing to do, because in this case I’m creating a new branch instead of committing the changes to “the other branch”.
Should I use the following command instead?
git merge "the other branch"
First, checkout to your new branch. Then, add all the files you want to commit to staging. Lastly, commit all the files you just added. You might want to do a
git push origin your-new-branchafterwards, so your changes show up on the remote.