Possible Duplicate:
How to open-source a project whose git repository has copyrighted media in the history?

Our company has spent a year working on an internal web application and has decided to open source the project and host on github. The application was originally versioned with Bazaar and we are going to preserve the commit history when converting it to git.

There is some confidential information within the commit history, such as internal database information.

Is there a way to preserve the commit history while removing or hiding all traces of confidential information?

The big reason being that we have had employees that have worked on the project that have moved on to higher-paying other jobs and we want to maintain recognition of their hard work.

  • Is you problem the identification of confidential information, or the mechanical process of changing the identified commits?
    – mattnz
    Jan 8, 2013 at 20:12
  • Mostly the mechanical process of changing the identified commits. If you know of a nice UI for examining the commit history, that would be very helpful as well. Jan 8, 2013 at 20:15
  • 3
    Their hard work was recognised by a monthly paycheque.
    – James
    Jan 9, 2013 at 0:28
  • 2
    Cannot understand the close votes. This question, while specific in it's current form, covers a common issue for software developers - removing (confidential) information from source control.
    – mattnz
    Jan 9, 2013 at 2:48
  • Perhaps your opinion would change if I told you that this wasn't for a company, but for a low-paying student job (hence hard-coding passwords and other sensitive information in the code-base) where the portfolio of a large open-source project meant more than the "paycheque". Jan 22, 2015 at 0:55

1 Answer 1


GitHub has a help page on Removing sensitive data. This page describes in detail how to use git filter-branch to remove old commits that have sensitive information.

This is the general workflow you can use:

  1. Convert the complete repository from Bazaar to Git.
  2. Identify commit(s) that have confidential information.
  3. Remove the confidential data with git filter-branch.
  4. After you are satisfied that you have removed all the confidential information, then you can upload to GitHub.

To view the commit history, Git comes with the built-in gitk tool. I normally use tig which is a text mode repository viewer. There are many other possible repository viewers to choose from, your favourite IDE probably already has something built in.


Not the answer you're looking for? Browse other questions tagged or ask your own question.