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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:01:51+00:00 2026-06-09T23:01:51+00:00

I like to reuse some code of a GIT maintained project for another project.

  • 0

I like to reuse some code of a GIT maintained project for another project. The working code is a good kickstart to the new project, despite most of it would come obsolete for the new needs. So the question is what would be the best practice for handling that?

I could

  • Make a new repository for the new thing and cherry pick the files from the old project. After stripping the code to match the needed basic funcitonality of the new project do the first commit to keep it’s history clean from useless things. Maybe it takes some time to conform this goal. Also, there is no way to merge enhancements done in the old project.

  • Branch the old code and adapt it to it’s new job step by step. That means the two projects will stay entangled inside one repository, that has one name, one README on GitHub etc.

  • Create the new project, beginning with a minimal main part, and another library project, serving as a common collection for both the old and the new project. However, with HTML and JS development, that makes many headaches as importing is complex in JS, impossible in HTML, there is the need to pull two repo’s to get each of the project running etc.

What would you do? Are there any GIT tricks that would support me?

  • 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-09T23:01:53+00:00Added an answer on June 9, 2026 at 11:01 pm

    Perhaps this is less of a version control problem and more of a refactoring one. It sounds like there may be enough shared code to pull out common functionality to its own project, which you could reference (by git-subtree or git-submodule) in the others. This way, if you do make fixes/improvements to the shared code, all your projects could benefit.

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

Sidebar

Related Questions

I am working on address book synchronization algorithm. I would like to reuse some
I would like to reuse some existing code in our code base that accepts
We're porting a legacy Java app to JRuby and would like to reuse some
I'm trying to reuse some script that I have working on another page, but
I have some template/starting point code that I reuse across projects. While working on
I want to reuse some code like the following: instance ToJavascript j => YesodTemplate
In my project, I want to reuse some code for multiple binaries (.exe). So,
I would like to reuse the exact same font-face etc... like Android uses in
I would like to reuse certain packages installed systemwide, while ignoring all others. I
Is it to be considered good practice to reuse RFC HTTP Status codes like

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.