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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:53:00+00:00 2026-05-23T01:53:00+00:00

A similar question, How to cherry-pick multiple commits , assumes that the commits are

  • 0

A similar question, How to cherry-pick multiple commits, assumes that the commits are consecutive.

I have a module that I downloaded as a tarball. I’ve included it in my main project’s git repo and made changes to it. These changes are interspersed with other commits for the main project.

I’ve realized the error of my ways and want to replace the module with a git submodule. I could just add the current state, but I want to keep my git history.

How can I move each individual commit into my new repo?


I think I can do this with cherry-pick, but it’s time-consuming. Here’s what I have:

Setup my new repo with the main project as a remote (so I can cherry pick):

cd ~/snippets
git remote add main ~/.vim/
git fetch main

I can see the relevant commits in the main project with git log ~/.vim/snippets

I can make a script to cherry pick with

cd ~/.vim/snippets
git log --oneline --reverse --format="format:git cherry-pick %h #%s" .

But if I run the script, there are merge conflicts. After I resolve a merge and commit, I need to remove the successful bits from my cherry pick script and run it again. I’d like to do this automatically, like git rebase.

  • 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-23T01:53:01+00:00Added an answer on May 23, 2026 at 1:53 am

    You may find git filter-branch to be helpful — if you use --tree-filter to move the files around and --commit-filter to remove commits that have no effect on your branch, then you should be able to end up with a branch containing just the changes from your sub-project.

    If you don’t have time for that now, you could use my other answer as an interim measure :).

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

Sidebar

Related Questions

Similar question to, Does it make sense to have multiple tomcat instances on the
Similar question here but this is slightly different... I have two tables that I
A similar question was posted as question:is-there-a-way-to-use-multiple-wsit-client-xml.. . I have two different WS-Security enabled
I asked a similar question yesterday, but recognize that i need to rephase it
Similar question from last night, I don't have access to edit the source HTML
Similar question: Using Silverlight for an entire website? That question is over 2 years
Despite similar question was asked , I have differnet situation: My app consists mostly
I have asked a similar question to this one already but I think it
I know similar questions (regarding cherry-picking) have been asked before, but I haven't really
This similar question gave the solution that in order to check the status of

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.