Answer the question
In order to leave comments, you need to log in
Remove sensitive information from a commit?
Hello. I committed and pushed sensitive information that I would like to remove from the repository completely. git revert will only create a new commit, but I wish the information couldn't be accessed via the github history.
Is it possible? If so, how?
Thanks in advance.
Answer the question
In order to leave comments, you need to log in
documentation here: https://git-scm.com/book/en/v2
Use the force, Luke.
You can overwrite commits. If the unwanted change was made in the last commit, you can simply make the necessary changes and the git commit --amend
If changes were made earlier can be used git rebase --interactive
to make changes to previous commits.
However, all these changes will only create new commits. And the old ones, although they will not be visible in history, can still be accessed by their hashes.
PS GitHub periodically launches a garbage collector, so sooner or later, commits that are not available in the history will be deleted.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question