How Can I hide a commit in GITHUB

13,790

The only way to purge that diff is with a force push. If multiple people are working on that same branch, you'd best let them know that you're rewriting history.

Assuming it 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 security precautions, I would also reset those passwords if they're linked to sensitive data...

Share:
13,790
Esat IBIS
Author by

Esat IBIS

Graduated from Osmangazi University as Computer Engineer, Studying Interactive Web Design and Development at Georgian College.

Updated on June 14, 2022

Comments

  • Esat IBIS
    Esat IBIS almost 2 years

    I posted some code in github but accidentally posted some passwords too and I changed them but it still seen in the commit section.

    How could I hide that commit?

  • Alaa M.
    Alaa M. almost 3 years
    Sorry for reviving a 7 yo post, but any idea on how to do it if it's not the last commit?