Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

marked as duplicate by gnat, Martijn Pieters, Karl Bielefeldt, Carson63000, BЈовић Jan 17 '13 at 7:58

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Is you problem the identification of confidential information, or the mechanical process of changing the identified commits? – mattnz Jan 8 '13 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. – OozeMeister Jan 8 '13 at 20:15
Their hard work was recognised by a monthly paycheque. – James Jan 9 '13 at 0:28
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 '13 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". – OozeMeister Jan 22 '15 at 0:55
up vote 8 down vote accepted

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.

share|improve this answer
gitk looks awesome! Thanks a lot! – OozeMeister Jan 9 '13 at 19:28

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