0

In one of the file of my project there is the code of the protection dongle. Normally before committing I set the code to 0, but once I forgot to do that and now the code is stored the local git archive. I don't want to discharge all the history (I made some other commits after), but I only want to remove that specific file from that specific commit (I know its SHA) leaving all the other committed file in the same commit.

Is it possible? If yes, how can I do it?

I followed the steps indicated here: https://sethrobertson.github.io/GitFixUm/fixup.html#change_single_deep_simple (my case should be "Changing a single commit involving only simple commits") but I don't know how to remove the file with the code.

  • http://stackoverflow.com/questions/872565/remove-sensitive-files-and-their-commits-from-git-history?rq=1 – Mat Sep 26 '16 at 09:11
  • Why don't you just fix the file, commit it, and then move on? Can you rewrite the history of the branch? – Tim Biegeleisen Sep 26 '16 at 09:12
  • Because I don't want to push the commit and discose the code to the external collaborators. The code must be secret inside the company. – Angelo Mascaro Sep 26 '16 at 09:29
  • The question 872565 does not apply. I don't want to remove the file, otherwise the project does not compile. I want to remove only the one commit with the code inside. – Angelo Mascaro Sep 26 '16 at 09:31

1 Answers1

0

Following the link Remove sensitive files and their commits from Git history I got here https://help.github.com/articles/remove-sensitive-data/ where there is the tool named BFG. It could be maybe brute force, anyway it replaced all the occourences of the secret code.

Community
  • 1
  • 1