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

  • Home
  • SEARCH
  • 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 5999841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:36:33+00:00 2026-05-23T00:36:33+00:00

I’m currently open sourcing a project that we’ve been developing on our own personal,

  • 0

I’m currently open sourcing a project that we’ve been developing on our own personal, private git server. We want to open source part of this project on GitHub as there are still features in development that need to be ironed out.

In particular, suppose I have the following directories in my git repo:

  • subdir 1 (public)
  • subdir 2 (public)
  • subdir 3 (private)

We would like to make dirs 1 and 2 public, while keeping dir 3 private. Is there a good way to do this?

  • 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-23T00:36:33+00:00Added an answer on May 23, 2026 at 12:36 am

    My best guess is that you want to use submodules. You can have your top level directory simply contain those three submodules. Two will be made public, one not.

    The parent project only knows the desired commit SHA1 of the submodule, so it won’t contain any actual information about the private project.

    If you don’t want to preserve history, you can simply copy those three directories into new places, run git init in them, and commit.

    If you do want to preserve history, you’ll want to do something like this:

    git clone original-project project1
    cd project1
    git filter-branch --prune-empty --subdirectory-filter subdir1 -- --all
    

    once per subproject. The filter-branch command rewrites history, leaving only the given subdirectory as the top level. This is obviously potentially destructive (though it leaves copies of refs in refs/originals/*) so it’s pretty important to do it in a separate clone!

    In either case, you’ll then go create your superproject:

    mkdir superproject
    cd superproject
    git init
    git submodule add <URL of central project1 repo>
    git submodule add <URL of central project2 repo>
    git submodule add <URL of central project3 repo>
    git commit
    

    It’s important to use the central URLs; when people clone your superproject and run git submodule update --init, it will clone the submodules from those URLs.

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

Sidebar

Related Questions

I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am currently running into a problem where an element is coming back from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
i want to parse a xhtml file and display in UITableView. what is the
I have a JSP page retrieving data and when single or double quotes are
Seemingly simple, but I cannot find anything relevant on the web. What is the

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.