git-oss-releaser converts a given git repository to a git repository only containing the files of the last commit and commits resembling git blame
output for each file.
The original history is lost.
The motivation is privacy of the developers involved. For instance, code comments made in range during development should not be made public.
git-oss-releaser is written using Python 3 and requires at least Python 3.5.
A discussion about this feature is made at stackoverflow.
GIT OSS releaser has been used in the context of the awesome-bpm list. The commits from Dec 16, 2015 present the results of the application.
usage: git-oss-releaser.py [-h] repoDir outDir
Positional arguments:
repoDir
: The repository to transform. May also be a subdirectory of a repo.outDir
: The directory where the new repo should be created. Has to be empty.
Optional arguments:
--name NAME
Theuser.name
to use for committing the files. Defaults to git's globaluser.name
.--email EMAIL
Theuser.email
to use for committing the files. Defaults to git's globaluser.email
.--date DATE
The date to use for commits. Defaults to the date the last commit.
Note that git distinguishes author and committer at a commit.
The author is taken using git blame
, the committer data is taken from the global user.name
and user.email
or the given configured --name
and --email
.
DEBUG mode can currently only be enabled in the code.
- Works on git repositories without any untracked files only
- Empty lines are assigned to "git-oss-releaser" and not the first or last author adding these empty lines
- Repository has to contain at least one non-binary file
- Commit date is derived from non-binary files only
- Tested under git for windows only
-
Google's Copybara - synchronizes internal git repositories with public git repositories including transformations.
Copybara should do what you want. It is able to filter commits using origin_files and also scrub information from commit message or files (We don't recommend this so that the migration is reversible and you are able to import Pull Requests from your external contributors). We also support several kind of transformations. Mode i) is what we call SQUASH mode and MODE ii) ITERATIVE. CHANGE_REQUEST is the mode that allows to import back contributions from non-source of truth repositories (someone sends you a pull request to the public repo) Mikel in a comment to a stackoverflow-question.
-
Google's MOE - predecessor of Copybara.