6

I am aware of how to delete branches locally using

git branch -d <branch_name>

and how to delete both locally and remotely using

git push origin --delete <branch_name>

I recently learnt how to prune obsolete branches as well, only when doing so I see the changes reflected in the remote branch list when running this command

git branch -r

But the branch listing seems to still display me all the branches whenever I run this command

git branch

Is there a command to sync the changes from the remote to be reflected in the local branch listing, so that when I delete a branch on github I can pull the updates of all the branch changes i.e which one have been deleted and which still remain, into my local environment?

Phillip Boateng
  • 1,111
  • 1
  • 12
  • 16
  • 1
    So do you want this: You do a sync and your Git realizes that some local branch has been deleted on the remote, so then it automatically deletes yours? – Tim Biegeleisen Nov 02 '16 at 11:28
  • Part two: If so, do you immediately see potential problems with this? – Tim Biegeleisen Nov 02 '16 at 11:29
  • could you provide some examples (e.g. the output you get when calling each of your commands) – umläute Nov 02 '16 at 12:07
  • I do like to see if git has such a feature, i took a look and only think related to removing branchs a bit close to what is the desired was "git prune" but just for remote references on git. – Leonardocregis Nov 30 '21 at 13:12

0 Answers0