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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:19:08+00:00 2026-05-15T16:19:08+00:00

I would like to split out modules distributed with a bigger application into separate

  • 0

I would like to split out modules distributed with a bigger application into separate submodules and keep the ability to pull from upstream.

So this is more complex than Detach subdirectory into separate Git repository. I do not only have do use git-filter-branch once but want to keep the ability to pull upstream changes after I have done so (and upstream has not).

Simply rerunning git-filter-branch on the complete history from upstream now including new commits not found in my rewritten history is not an option as there are hundreds of modules for which I have to do this and the number of commits is getting close to 100.000.

I am guessing this involves limiting the history to just the new commits, rewriting those and then adding them after the previously rewritten commits, but I am unsure how to do this – and maybe there is a better approach.

It would be nice if branches and tags could be preserved too but this is not absolutely necessary and if it complicates things I would actually prefer to lose those.

  • 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-15T16:19:08+00:00Added an answer on May 15, 2026 at 4:19 pm

    For the first rebase do this:

    git checkout -b rebased master
    git filter-branch --some-filter
    git tag rebased-done master
    

    And to “merge” later commits:

    # Create a tempory branch and rebase it's tail use 'rebase-done~'
    # and not 'rebase-done' because some filters (like --index-filter)
    # require this, others might not.
    git checkout -b rebased-tail master
    git filter-branch -f --some-filter -- rebased-done~..HEAD
    
    # Get the commit in branch 'rebased' corresponding to tag 'rebase-done'
    # (which tags a commit in 'master' not 'rebased').  Depending on your
    # situation you might have to determine this commit differently (in my
    # use case I am absolutely sure that there is never a commit with the
    # same author date - if that doesn't work you might want to compare
    # commit messages).
    start_time=$(git show --quiet --pretty=%at rebased-done)
    start_hash=$(
    git log --reverse --pretty="%H %at" rebased_tail |
    while read hash time
    do
        [ "$time" = "$start_time" ] && echo $hash && break
    done
    )
    
    # Finally apply the rebased commits.
    git checkout rebased
    git format-patch -k --stdout $start_hash..rebased-tail | git am -k
    git branch -D rebased-tail
    git tag -f rebased-done master
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 508k
  • Answers 508k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer What kind of library are you using? If you use… May 16, 2026 at 4:22 pm
  • Editorial Team
    Editorial Team added an answer Have a look at this API: http://github.com/anagromataf/Map Is it what… May 16, 2026 at 4:22 pm
  • Editorial Team
    Editorial Team added an answer When you use a new expression the compiler generates code… May 16, 2026 at 4:22 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

We are currently writing an application which is split into multiple projects/modules. For example,
How would you parse the ['i386', 'x86_64'] out of a string like '-foo 23
I have created some custom PowerShell Cmdlets in C# and would like to provide
I'd like to find out the arity of a method in Python (the number
Currently my application takes in a text file/files, parses them into another file type
This snippet is from an earlier answer here on SO. It is about a
In our .Net CF app we are getting weird errors from parts of the
I know, there are some similar questions to the following out there, but I
I'm trying to read the contents of a text file into the attributes of
I'm using Maven's exec:java to run jline for one of my projects (current POM

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.