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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:31:35+00:00 2026-06-11T15:31:35+00:00

As I understand from http://www.kernel.org/pub/software/scm/git/docs/git-rebase.html the rebased branch is ‘moved’ on to another one.

  • 0

As I understand from http://www.kernel.org/pub/software/scm/git/docs/git-rebase.html the rebased branch is ‘moved’ on to another one.

What I see during my tests, though, shows that the commits from the rebased branch remain in the history, so they are effectively duplicated.

Before rebase:

After rebase:

Perhaps I’m missing something or don’t understand the purpose of rebase completely or both.

If what I see is the intended behavior, then why is it so?

  • 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-06-11T15:31:36+00:00Added an answer on June 11, 2026 at 3:31 pm

    There are two separate phenomena here.

    1. The screenshot you posted, from gitk, shows the old commit still. That’s just the way gitk works; If you reload by hitting Ctrl+F5 rather than just F5 (That’s File > Reload rather than File > Update for you mouse users) you’ll see the old commit disappears because it’s no longer relevant.

    2. There are lots of operations in Git that create commits. Even more that create file or tree objects in the file store. The fact that many of these objects are no longer used is irrelevant.

      This has a whole bunch of advantages. In your example, it means that if you decided your rebase was a bad idea, your old commit still exists and can be recovered. There’s even a handy syntax for it: topic@{1} refers to the commit that topic pointed to before the last time it moved; here that would be immediately before the rebase.

      The Git object model is clever about this sort of thing. Having an extra commit like this lying around takes up very little extra space. For a rebase like the one you’re describing, I’d expect holding on to the old branch would cost at most a few hundred bytes.

      Of course, that does add up over time. So git gc (which is run automatically by certain commands every so often for you) runs git prune. And git prune will look for commits and objects that are old and no longer relevant and clear them out for you.

    None of this means your rebase hasn’t worked, just that the idea of rebase “moving” commits is a simplification. What rebase actually does is apply the differences between each commit and its parent to the new branch, and creates a new commit with those differences for each commit on the old branch. It then updates the branch such that, if you look at the branch history, it’s as if those commits were moved.

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

Sidebar

Related Questions

I'am trying to understand the example from program_options of the boost library ( http://www.boost.org/doc/libs/1_38_0/doc/html/program_options/tutorial.html#id3761458
From web pages like this one, http://www.jsftutorials.net/components/step5.html I understand that the binding attribute in
From http://www.boost.org/community/implementation_variations.html ... coding differences such as changing a class from virtual to non-virtual
The code below from http://www.scalaclass.com/book/export/html/1 to do matrix dot product. I can't understand the
I’m trying to understand code from http://www.yesodweb.com/book/conduits . After some fixes (like replacing Resource
From what I understand using $this->db->insert() escapes the values: http://codeigniter.com/user_guide/database/active_record.html#insert Note: All values are
I would like to rewrite the URL of one of my pages from http://www.mydomain.com/some/application/page.html
Custom tool warning: The optional WSDL extension element 'annotation' from namespace 'http://www.w3.org/2001/XMLSchema' was not
My question is, what does this code do (from http://www.joelonsoftware.com/articles/CollegeAdvice.html ): while (*s++ =
I am trying to run this snippet from http://www.ibm.com/developerworks/linux/library/l-prog3.html on a python 2.6 runtime.

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.