0

I'm trying to get better in my usage of git. In using branches, there are a few steps that confuse me:

git branch my-new-branch
git checkout my-new-branch
... make changes ...
git add .
git commit -m "my changes"
git push origin my-new-branch

Now my remote new branch is up to date, and I want to merge it into master:

git checkout master
git merge my-new-branch

This seems to bring my local master up to date, but now my remote. What's the correct next step? Doing

git push

seems to do the trick... Is that ok?

Finally, I want to delete the my-new-branch branch.

git branch -d my-new-branch

Again, things look ok locally, but not on my remote. How do I get the remote up to date now?

Is this generally the right way to go about this? Some steps smell off to me...

theQman
  • 1,690
  • 6
  • 29
  • 52
  • What's the problem with your remote? Also you can create the branch and check it out in one command. `git checkout -b my-new-branch` – EncryptedWatermelon Nov 12 '19 at 19:04
  • Since you tagged with github: https://help.github.com/en/github/administering-a-repository/managing-the-automatic-deletion-of-branches – JB Nizet Nov 12 '19 at 19:06
  • 2
    Possible duplicate of [How do I delete a Git branch locally and remotely?](https://stackoverflow.com/questions/2003505/how-do-i-delete-a-git-branch-locally-and-remotely) – JB Nizet Nov 12 '19 at 19:07

0 Answers0