0

I somehow added a fork as a remote to my local repository and later on I issued git pull - to my dismay git pulled all fork branches as local tracking branches. How can I undo this with one command ? All branches show in gitk as remote/wr/branchname

Do I then have to remove the entry from .git/config ?

[remote "wr"]
    url = https://github.com/AUTHOR/wrye-bash.git
    fetch = +refs/heads/*:refs/remotes/wr/*
Mr_and_Mrs_D
  • 32,208
  • 39
  • 178
  • 361
  • Why a -1 ? The command for one branch would be `git branch -rd wr/branchname` - it's a legitimate question to ask for a command that does the same for all wr branches – Mr_and_Mrs_D Jan 11 '17 at 13:36

1 Answers1

1

Took me a bit of experimentation (I am not a console person):

git branch -rd $( git branch -r | grep 'wr/' )

Now if only I could add a dry run switch...

Mr_and_Mrs_D
  • 32,208
  • 39
  • 178
  • 361