Search code examples
gitgit-remote

Make a special version of a corporate repository public


We have an internal, corporate repository that I would like to make public, but with all internal information removed (like credentials, internal company structures, etc).

How can I achieve this? When I create a branch, it will contain the entire history. Basically I want to keep the two in sync, but still keep the public repository clean of any critical information.

Is this doable with a branch of some sort? I tried around a bit, but it always keeps pushing the complete history (which kind of makes sense).

The problem is: Currently, critical information is in the history. If I remove that in a commit, the removal will be part of the public history.

Basically, I want the "public" branch to start at a certain point of the actual history, without including any parents, but in the future follow the same history... How can I do this?


Solution

  • I would say create a graft for your "starting point" and then it should be seemless possible to go ahead with a normal branch:

    see:

    I hope it helps!