首页 > 解决方案 > How to delete file changes history on github?

问题描述

I was careless enough to forget not to include access credentials in my .gitignore and I pushed a file with security codes to my repo on github. Now, I've deleted the file on the last commit, but I can't seem to find a way to delete the file from github history so noone can see the history of changes and this way, the codes. I can't do it manually on github, as it says that I 'must be on a branch to make or propose changes to this file'. Since pushing that file I've done some other commits already. How do I fix that? I've changed the security codes already, but I would like to delete the old ones anyway. all the codes can still be viewed in the history

标签: gitgithub

解决方案


The safest thing is to assume that someone has already downloaded the credentials. Your question indicates you have already pushed them to github. Even if you do rewrite history, they are compromised and need to be changed.


推荐阅读