简体   繁体   中英

GIT Removing FETCH refs from remote tracking

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配置

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM