1

I am new to using GIT in eclipse i have been playing around with the tool and i did several push and merges to the server however i am seeing in the Remote Tracking option when i do a fetch i am getting branches i do not need or use anymore. How can i remove from Remote Tracking, branches i do not need anymore.

I attempted a delete however when i do a fetch again from the server they all come back. I also need these branch names however i cannot reuse them since they already exist. Under is a screen shot of what i see when i attempt to configure the FETCH option.

GIT FETCH CONFIGURATION

GIT FETCH CONFIGURATION

devdar
  • 5,434
  • 25
  • 93
  • 152

2 Answers2

1

You need to delete those branches on the server as well as locally:

git push --delete origin <branchName>

(As in "How do I delete a Git branch both locally and remotely?")

If you don't, the next fetch will bring those branches back.

Community
  • 1
  • 1
VonC
  • 1,129,465
  • 480
  • 4,036
  • 4,755
0

You can specify the default refspecs to fetch from a remote:

git config remote.origin.fetch +refs/heads/master:refs/remotes/origin/master

(likewise with remote.origin.push). Then delete the unwanted branches locally and fetch won't reload them unless you specifically ask.

jthill
  • 48,781
  • 4
  • 72
  • 120