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 633041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:08:30+00:00 2026-05-13T20:08:30+00:00

In Git, what does deletion of a branch mean? Will it be gone from

  • 0

In Git, what does “deletion” of a branch mean?

Will it be gone from the repository? Or will it still be navigable to via git branch?

What I really want to do is mark a branch as “dead end”, i.e., the branch is so far from master, that nobody should use it as a starting point, though there were some good ideas down that branch, so we’d like to keep it, for reference.

  • 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-13T20:08:31+00:00Added an answer on May 13, 2026 at 8:08 pm

    You can delete the branch, but tag it first, so that it’s history doesn’t disappear. This way, the branch doesn’t show up in the branch list, which should hopefully deter people from working on it, but the work won’t be permanently erased (even after garbage collection is run). For instance, whenever I have a branch that has become irrelevant, but I’m not prepared to permanently delete it, I tag it as “archive/<branch-name>”.

    While on master or some other branch:

    git tag archive/foo foo
    git branch -D foo
    

    This creates a tag named archive/foo from the foo branch before deleting foo. You can also add a message to the tag, that explains what is in the branch, why it existed, why it’s now a dead end, etc.

    git tag -m 'Foo is deprecated in favor of bar' archive/foo foo
    

    The ability to record why a branch is being deprecated is perhaps an advantage of tagging versus moving branches to an alternate namespace.

    If you ever need to resurrect a branch that has been archived this way, it’s as simple as:

    git branch foo archive/foo
    git tag -d archive/foo       # Optional
    

    Now the branch is back as though it was never deleted.

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

Sidebar

Related Questions

Does anyone know how one can restrict push to some git repository branch based
Our git server will be local, but we want an server where our local
git does not seem to do what I want here so I need some
How do I determine who pushed to the repository? I.e. Somebody does git push
I'm sharing a git repository with a colleague, and because git does not propagate
I moved a git repository from ext3 to a fat32 usb pendrive and later
running git instaweb in my repository opens a page that says 403 Forbidden -
When git does a commit it rewrites binary files with something similar to rewrite
git rebase does not appear to work properly in certain cases where a file
There was a small discussion about what git does and doesn't do by default

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.