Git Force Push Practices

The cluster focuses on debates about using git push --force, its risks like overwriting remote history, safer alternatives such as --force-with-lease, and best practices like disabling it on shared branches or main repos.

➡️ Stable 0.5x DevOps & Infrastructure
2,316
Comments
19
Years Active
5
Top Authors
#5110
Topic ID

Activity Over Time

2008
3
2009
16
2010
44
2011
74
2012
100
2013
227
2014
130
2015
133
2016
174
2017
99
2018
90
2019
140
2020
167
2021
164
2022
200
2023
189
2024
159
2025
200
2026
7

Keywords

reasonablypolymorphic.com GitLab CI HEAD GitHub PR index.html push git branch force repo commits remote commit branches rebase

Sample Comments

adamwong246 • May 27, 2014 • View on HN

How about 'git push --consensual'?

Osiris • Dec 4, 2013 • View on HN

If no one has pulled your branch, just do a force push (use --dry-run to double-check your push).

ggregoire • Jul 26, 2021 • View on HN

Still need to be able to "push --force" on the remote repo for this to be useful, right?

lez • Oct 23, 2019 • View on HN

I really hope force push is disabled on the repo :)

drekipus • Jun 2, 2024 • View on HN

Can you still push to the repo? Perhaps via --force?

karatinversion • Nov 23, 2023 • View on HN

No, that’s not right. If you did that, you would need to force push to get the result pushed to the remote.

talldan • May 11, 2019 • View on HN

There's git push --force-with-lease, which is a safer alternative.

emmelaich • Dec 15, 2025 • View on HN

Surprised that people allow force-push on git. If it needs to be done, it should only be done after consultation and disabled after.

cjrp • Aug 19, 2015 • View on HN

He must be using push --force in that case.. which seems like a bad practise.

newaccount74 • May 1, 2022 • View on HN

Why do you force push to their branch, instead of committing your fixes as separate commits later on?