0

I have a git repo that I have decided to make public, which means moving database connection info into a .gitignored file. However, my repository history still contains the commits that I added and then removed the information.

I have tried the solution from this question using interactive rebase, but this seems to only allow me to change/reorder the commit message, not the code that was included in the commit.

Community
  • 1
  • 1
diplosaurus
  • 2,538
  • 5
  • 25
  • 53

1 Answers1

3

You should read this article from Github:

Remove sensitive data

But, the most important part of the article is certainly this quote:

Danger: Once the commit has been pushed you should consider the data to be compromised. If you committed a password, change it! If you committed a key, generate a new one.

Sandro Munda
  • 39,921
  • 24
  • 98
  • 123
  • You should post a blurb for the link, in case it becomes broken. – Stefano Sanfilippo Feb 21 '14 at 12:51
  • Just a small addition. "Once pushed, it becomes compromised" is true only for a repository that's already made public. If a repository is just being prepared for that, nothing is compromised yet. – Ellioh Feb 21 '14 at 12:57
  • A-ha, thank you! I found BFG at the link you provided, which changed everything I wanted to `**REMOVED**` I would have preferred it just leave the changed info blank, but it'll do. Thanks again. – diplosaurus Feb 21 '14 at 13:31