I want to make my local branches to match all the remote branches. For example, imagine that I have these branchs in my git:
- branch-foo
- branch-bar
and in my github repo I have these branchs:
- branch-foo
- branch-baz
I would like to make my local branches to be:
- branch-foo
- branch-baz
In other words, remove all branches that don't exist in github, pull the branches that don't exist in github and keep the branches that still exists in github.
I've normally do this manually with git pull [origin] [branch] to update branchs, git switch|checkout [branch] to go to a particular branch or git branch -a | git branch -D [branch] to check the existent branchs and remove them, but this is kinda slow, there is a command (or set of 1-2 commands) that could do this automatically?