Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6612981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:09:45+00:00 2026-05-25T20:09:45+00:00

If other developers push their local branches to a shared remote repository before committing

  • 0

If other developers push their local branches to a shared remote repository before committing to trunk (to share, backup, or centrally store them for access from multiple machines), is there a way for me to easily only fetch my own branches or selectively delete local references to others’ remote branches? If not, is there a way to only show a subset of remote branches in gitk, so I can see where my branches are relative to my remote branches, but not have the graph cluttered by everyone else’s remote branches?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T20:09:46+00:00Added an answer on May 25, 2026 at 8:09 pm

    Here’s one way of only fetching particular branches from a remote:

    The refs (including branches) that are fetched from a remote are controlled with the config option remote.<remote-name>.fetch. For example, your remote.origin.fetch is probably the refspec:

    +refs/heads/*:refs/remotes/origin/*
    

    … which means to make fetch the names of all the refs under refs/heads/ in the remote repository, and make them available under refs/remotes/origin/ in your local repository. (The + means to do forced updates, so your remote-tracking branches can be updated even if the update wouldn’t be a fast-forward.)

    You can instead list multiple refspecs that specify particular branches to fetch, e.g. changing this with:

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

    … and then the next time only master and blah will be fetched.

    Of course, you already locally have lots of remote-tracking branches, and gitk will still show those. You can remove each of the ones you’re not interested in with:

    git branch -r -d origin/uninteresting
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is what I did: Cloned a remote repository to my local computer. Created
I've done something like following: (1) clone a remote git repository to local host
I'm curious to see how other developers go about testing their web sites. PHP
I was wondering how other developers begin refactoring. What is your first step? How
Me and several other developers are currently cleaning up our legacy code base, mostly
I'm just wondering how other developers tackle this issue of getting 2 or 3
I am curious as to how other developers use delegates and/or events other than
I'm building a jar so that other developers can use the view I create
I need to leave some instructional comments for other developers on a page/user control.
I am currently working on a project with five other developers and we are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.