How to hide a commit in GITHUB

I sent some code to github, but accidentally sent some passwords, and I changed them, but it is still visible in the commit section.

How can I hide this message?

+4
source share
1 answer

The only way to clear this diff is by force pressing. If several people are working on the same branch, it is best to let them know that you are rewriting a story.

Assuming this was your last commit ...

git reset --soft HEAD~
(undo password changes)
git diff
(make sure there are no changes that display the passwords)
(stage/commit changes)
git push origin +branch_name

Following standard precautions, I would also reset these passwords if they are associated with sensitive data ...

+4
source

Source: https://habr.com/ru/post/1524439/


All Articles