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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:44:43+00:00 2026-06-10T08:44:43+00:00

I have a project that is open sourced using git for revision control. Soon,

  • 0

I have a project that is open sourced using git for revision control. Soon, I am going to release a premium hosted version of the project as well, but there will be changes made to the code specifically for the premium hosted version (performance, etc.), that should not exist in the open source version.

I want to avoid having two separate directories/projects, because if I fix a bug in the open source version, that bug is most likely in the premium hosted version as well. I don’t want to make changes in two places.

What is the best way to manage this? Simply branching in git won’t work right, because some files need to have 2 versions: an open source version and a premium hosted version.

  • 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-10T08:44:45+00:00Added an answer on June 10, 2026 at 8:44 am

    And yet, branching should work, and will allow you to maintain two separate versions.

    If you have a bug which applies to the premium version, fix it on master, and merge it on premium branch.
    Git will only merge what has changed since you branched between master and premium, ie your bug fix.
    On another way to publish an hotfix both in master and premium would be to do it from the common ancestor: see “Git merging hotfix to multiple branches“.


    Update 2015: git 2.5 (July 2015) has replaced git-new-workdir presented below by the new command git worktree add <path> [<branch>].

    For more, see “Multiple working directories with Git?“.


    Original answer 2012:

    me-and mentions in the comments the command git-new-workdir.
    See:

    • Working with a branch using git-new-workdir“
    • “The Nuclear Squid git-new-workdir“

    One solution to this is to simply create another local clone of your repository. Git automatically uses hard links when you clone locally, so cloning is very fast.
    But there is one problem with this: You now have another, separate repository you need to keep up to date.

    This is where git-new-workdir comes in.
    Instead of doing a full-blown clone of your repository, it simply sets up a new working directory (with its own index) for you.
    The actual repository itself is shared between the original and the new working directory. This means:

    • If you update one repository, the new commits are instantly visible in all other working directories as well.
    • Create a new commit or branch in one of your working directories, they’re instantly available in all working directories.

    Note: Even though the commits are automatically there, Git won’t update the working copy if you’ve got the same branch checked out. You’ll have to do that for yourself.

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

Sidebar

Related Questions

I have a pure ActionScript 3 project that I build using the open source
We have the problem that we have the open project files in our SVN
I have a project that using some third-party libraries. My questions is how to
I have been hearing a lot about the advantages of using a version control
I have a project that references a number of open source libraries, some new,
I have a web-based application that I would like to open source by using
I am working a project that is going to be made open source eventually.
I am working on an open source javascript project using backbone that uses a
I have project that I'm working on that is going to require a webserver.
I have(ie, own) an open source project that I want to do some work

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.