Hacker News new | ask | show | jobs
by aferreira 4598 days ago
Always always _always_ use git push <remote> <branch>. Always. Did I mention always? :)
1 comments

After my first bad force push (silly git push default on an unfamiliar machine) I now 'enforce' the `git push remote from_branch:to_branch` syntax on myself when force pushing, I also have adopted the habit of always accompanying any --force with a --dry-run.
Maybe that should be the default. It does a dry run and if you're sure you add --do or something.
It could have a simple 'are you sure y/n' prompt, and you could then have a git config setting to disable this.