git - 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
解决方案
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.
推荐阅读
- excel - 如何从非活动工作表中引用 VBA 中的命名范围?
- python - 编写文件,读取它们并使用不同的模块调用它们
- django - base64 编码从 .bash_profile 返回 None ,我将其保存为环境变量
- reactjs - 如何使用 useLazyQuery() 在每次点击时执行查询
- webrtc - 如何查看转向服务器日志?
- php - 返回不在父项中的子类别
- jquery - 如何使用 CodeIgniter 调试 jQuery ajax url 是否工作
- reactjs - 用 typescript 反应 CRA 不能与 eslint 一起工作
- android - 当 Snapshotlistener 检测到位置变化时更改标记位置,Android studio Google Maps api
- php - 未找到 PHP 类“Ds\Map”