14

'I don't want to push this commit yet'

Proceeds to write commit title and presses push.

'Wait, fuck ..'

Comments
  • 1
    It would be nice to have a 'git unpush' command
  • 1
    @cafecortado lets call it 'oh shit, ctrl+z ctrl+z ctrl+z'
  • 1
    I do like me a git stash some times.
  • 1
    Well, as long as you are not committing directly to master nbd. Amend the heck out of it
  • 0
    @C0D4 that's what I said until I learned git pop. And then I keep forgetting I don't have a stash when I git reset --hard
  • 2
    git reset to previous commit, then git push -f. You could probably make a git unpush alias
  • 1
    The same feeling when we are walking on a bridge and have to hold our phone tight so we don't throw it on the water 😅
  • 1
    I know this is a general rant and I've had this happen to me many times

    but a Legit tip is to prevent involuntary commits and pushes to master by adding a /.git/hooks/pre-push and a /.git/hooks/pre-commit to your repo

    Those files allow you to specify which branches (like main/master) you wanna get a warning if you try to commit or push to
Add Comment