Use environment variables or secret management tools (like GitHub Secrets) instead of hardcoding credentials in text files. Are you trying to a lost file, or
AWS_ACCESS_KEY_ID = "AKIAIOSFODNN7EXAMPLE" AWS_SECRET_ACCESS_KEY = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
: Deleting the file or the commit is not enough, as it remains in the Git history. Use tools like BFG Repo-Cleaner git filter-repo
git filter-branch --force --index-filter \ "git rm --cached --ignore-unmatch password.txt" \ --prune-empty --tag-name-filter cat -- --all
: Change the password or revoke the API key. Assume it has already been compromised.
To create a file named password.txt on GitHub, follow these steps to add it directly through the web interface. Steps to Create a password.txt File