I have not used it myself, but the open source BFG Repo-Cleaner looks like it might satisfy your requirements of simplicity while retaining the activity chart for reviewers to view. This can be done on a publicly-facing copy of the repo if you wish to keep your private working copy, while still keeping the activity history viewable.
Following the tool's usage instructions, you should be able do the following (assuming you want these changes in a fresh copy of the repo):
The first step is to duplicate the repository on GitHub, following the instructions in the GitHub docs.
To do this, first create a new repository.
Next, mirror the repository, following the GitHub instructions:
- Open Terminal.
- Create a bare clone of the repository.
$ git clone --bare https://github.com/exampleuser/old-repository.git
- Mirror-push to the new repository.
$ cd old-repository.git
$ git push --mirror https://github.com/exampleuser/new-repository.git
- Remove the temporary local repository you created earlier.
$ cd ..
$ rm -rf old-repository.git
Now that you have the duplicate repository, you can run the BFG Repo-Cleaner to replace all instances of text you want hidden with ***REMOVED***
.
$ java -jar bfg.jar --replace-text replacements.txt my-repo.git
The replacements.txt
file would contain the SMTP, MongoDB URI, and any other text you want hidden.
mongodb://my-username:my-password@host1.example.com:27017,host2.example.com:27017/my-database
marco-f@example.com
Note that this does not update the latest commit on the master
/HEAD
branch, so this will need to be manually changed, and then committed. This can either achieved using a final commit using the --amend
option, or by making a new commit prior to running the BFG Repo-Cleaner with the files manually changed.
$ git commit --amend
Now that the changes have been made, they can be pushed to GitHub.
$ git push