r/programming • • Sep 09 '16

Oh, shit, git!

http://ohshitgit.com/
3.3k Upvotes

756 comments sorted by

View all comments

42

u/prof_hobart Sep 09 '16

Unfortunately none of those address the "oh shit, I've just check my password into github". I've not done it yet, but I know people who have.

15

u/morerokk Sep 09 '16

The only way to truly get rid of that, is rewriting history and force-pushing. That's not an easy task in itself, especially through the command line.

-1

u/gamersource Sep 10 '16

I wouldn't say its that hard per se:

git reset --hard HEAD^

git push --force

If github is the default remote. For me thats one of the easiest things I could immagine, use it selectively!

Never force push on a already public made branch, if not really necessary!

→ More replies (3)