git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Partially private repository?

From
DLDaed Lee <daed@thoughtsofcode.com>
Date
Feb 1, 2010, 04:59 UTC
Message-ID
<78d8a6b51001312059s1811b631y838679a3f63188b0@mail.gmail.com>
In-Reply-To
<32541b131001291410g252ddff4lbf04ac7c1d2d33fc@mail.gmail.com>
On Fri, Jan 29, 2010 at 5:10 PM, Avery Pennarun <apenwarr@gmail.com> wrote:
Show 20 quoted lines
> On Fri, Jan 29, 2010 at 5:01 PM, Daed Lee <daed@thoughtsofcode.com> wrote:
>> Hi, I'm wondering if git can handle the following use. I have a
>> project that started as private experiment, but has morphed into
>> something I'd like to release publicly. I want to give others access
>> to the repository, but only to commits after a certain cutoff date.
>> Commits prior to that date have things like hardcoded file paths,
>> emails, etc. that I'd like to keep private.
>>
>> I suppose the easiest thing to do would be to create a new repository,
>> add the project files to it, and make that public, however I'd like to
>> keep my private commit history along with the public commit history
>> going forward in a single repository if possible. Is there a way to do
>> this with git?
>
> You should probably split your history into two pieces: the "before"
> and "after" parts.  To split out the "after" part, you could use
> git-filter-branch
> (http://www.kernel.org/pub/software/scm/git/docs/v1.6.0.6/git-filter-branch.html).
>  Then, in your private copy of the repo, you could reattach the
> "before" part of the history using git grafts.

Going forward, if I made changes to my private repository (containing the "before" and "after" parts) and pushed to the public repository (containing only the "after" part), would this only push the commits in the "after" part? Essentially, I want to develop in my private repository and see my "before" and "after" changes when I "git log/show", but only push the "after" changes to the public repository.

I've also been looking into private branches. Could I do something like keep my "before" changes on a private branch, and then do all future development on a public branch?

Thanks for the pointer to git grafts, I'll have to read up on it further.
Previous: Avery PennarunNext: Johannes Sixt
Message 3 of 4 in “Partially private repository?”
  1. Daed LeeJan 29, 2010
  2. Avery PennarunJan 29, 2010
  3. Daed LeeFeb 1, 2010
  4. Johannes SixtFeb 1, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.