I have a setup where I am working on a desktops in two different locations. For each, origin
is set as a GitHub repo. When I'm working on computer A and I finish and merge a branch I do:
git branch -d <somebranch>
git push -d origin <somebranch>
git checkout master
git push
Then say I switch to my other system to work from there, I do:
git fetch
git pull
and I delete the local copy of that same branch that I managed to finish up on the other system (which I'd been working on previously on this one)
git branch -d <somebranch>
However, I still see when doing
git branch -a
that the
remotes/origin/<somebranch>
still exists.
I then delete it again like I did from the other computer:
git push -d origin <somebranch>
But is this always the way it has to be done? I'm wondering if there is a method with fewer steps that allows things to 'sync' a bit more intuitively. I'm basically not sure if all these manual deletions are the norm, and would be interested to hear if I'm missing some important details about common Git commands. Thanks