A
A
Alex Wells2018-02-10 19:09:39
git
Alex Wells, 2018-02-10 19:09:39

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

2 answer(s)
A
aol-nnov, 2018-02-10
@aol-nnov

documentation here: https://git-scm.com/book/en/v2
Use the force, Luke.

A
Alexander Movchan, 2018-02-10
@Alexander1705

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 --interactiveto 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 question

Ask a Question

731 491 924 answers to any question