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

  • SEARCH
  • Home
  • 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 3304290
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:02:46+00:00 2026-05-17T21:02:46+00:00

From the man page: Deletes all stale tracking branches under <name>. These stale branches

  • 0

From the man page:

Deletes all stale tracking branches under <name>.
These stale branches have already been removed from the remote repository
referenced by <name>, but are still locally available in "remotes/<name>".

So I removed a bunch of branches using

git push origin :staleStuff

and then ran

git remote prune origin

However, only one single local branch was pruned. Some of these branches were created by me, some by co-workers. Does this indicate that I wasn’t tracking those branches correctly in the first place?

  • 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-17T21:02:46+00:00Added an answer on May 17, 2026 at 9:02 pm

    When you use git push origin :staleStuff, it automatically removes origin/staleStuff, so when you ran git remote prune origin, you have pruned some branch that was removed by someone else. It’s more likely that your co-workers now need to run git prune to get rid of branches you have removed.


    So what exactly git remote prune does? Main idea: local branches (not tracking branches) are not touched by git remote prune command and should be removed manually.

    Now, a real-world example for better understanding:

    You have a remote repository with 2 branches: master and feature. Let’s assume that you are working on both branches, so as a result you have these references in your local repository (full reference names are given to avoid any confusion):

    • refs/heads/master (short name master)
    • refs/heads/feature (short name feature)
    • refs/remotes/origin/master (short name origin/master)
    • refs/remotes/origin/feature (short name origin/feature)

    Now, a typical scenario:

    1. Some other developer finishes all work on the feature, merges it into master and removes feature branch from remote repository.
    2. By default, when you do git fetch (or git pull), no references are removed from your local repository, so you still have all those 4 references.
    3. You decide to clean them up, and run git remote prune origin.
    4. git detects that feature branch no longer exists, so refs/remotes/origin/feature is a stale branch which should be removed.
    5. Now you have 3 references, including refs/heads/feature, because git remote prune does not remove any refs/heads/* references.

    It is possible to identify local branches, associated with remote tracking branches, by branch.<branch_name>.merge configuration parameter. This parameter is not really required for anything to work (probably except git pull), so it might be missing.

    (updated with example & useful info from comments)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

All below is from man epoll page: The function do_use_fd() uses the new ready
From pthread_join() man page : When a joinable thread terminates, its memory resources (thread
I have a doubt regarding the backlog value in listen system call. From man
From the gemfile man page , I learned there are two ways to import
I have index page with navigation menu like this man caps shirt jeans woman
This is a code from Linux man page: #include <stdio.h> #include <stdlib.h> extern char
From the recv(2) man page: MSG_WAITALL This flag requests that the operation block until
The man page for xcodebuild reads: Run xcodebuild from the directory containing your project
I've been trying to figure this one out by reading the git-svn man-page but
Note on pri from ps man page: pri PRI priority of the process. Higher

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.