1

I committed some stuff to github that I would prefer that I hadn't. It's not super sensitive. It's the domain name that I use to access my home IP address. It's not keys, certificates or credentials or anything.

I have removed the domain name and rebased and squashed out the commit that contained the domain name.

Is this commit still available on my public github site? Locally I am pretty sure I could get that commit back by using git reflog but I am hoping that the data in github has been automatically pruned and is no longer accessible.

Roaders
  • 4,373
  • 8
  • 50
  • 71

2 Answers2

1

I believe the commit should be gone for all new clones and fetches after you removed it, but there's an easy way to prove this: simply clone the repo again and see if it's still there. (It shouldn't be).

Assuming it is gone when you clone, then the only people that could potentially still access it are those that had pulled it down locally while it existed, and if they had checked out the branch during that time it could potentially remain forever until they either delete their local branch, or reset it to match your latest version.

If you created a Pull Request with the branch, you may also want to look at the PR history to see if the commit is still accessible there.

TTT
  • 22,611
  • 8
  • 63
  • 69
0

You can try a hard reset and force push command...

git reset --hard your local branch to remove changes from working tree and index,

and you git push --force your revised local branch to the remote.

Example:
git reset --hard 
git push --force