最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

git - Unable to remove a file from GitHub commit history even after running BFG tool - Stack Overflow

programmeradmin1浏览0评论

I have file abc.properties on my repo which appears under the security report tab because of some sensitive data found on it on some previous version.

When looking at the security tab there is certain commit: "DDD" which still contains the file and change text with the sensitive data showing. This also has the following message at the top: "This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository."

I tried following the recommended steps from using BFG and the tool's page: and arrived to the following script in Windows:

cd "C:\workspace\bfg_cleanup\PATH"
git clone --mirror https://<ON PREMISE ENTERPRISE GITHUB>/USER/REPO
java -jar C:\bfg\bfg-1.14.0.jar --delete-files abc.properties REPO.git
cd "C:\workspace\bfg_cleanup\PATH\REPO.git"
git reflog expire --expire=now --all
git gc --prune=now --aggressive
git push --force

After running my script there are not any warnings or errors shown, but when going back to Github the commit of the file abc.properties is still showing on the history of hash DDD.

Some points to note:

  • File abc.properties is deleted from the current branch.
  • The GitHub version used is GHES.

Would appreciate any help for this as I am not able to remove that file's commit history and it is still appearing on the security report tab.

发布评论

评论列表(0)

  1. 暂无评论