How to disable force push prompt globally? #5615
-
|
How to disable the force push prompt? I've accidentally hit Enter a couple times already and removed some commits that I needed, was not a great experience. Whenever the remote contains commits that are not present locally, pulling is the right thing to do, not force push, I believe. Please advice. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I would only agree with this if those remote commits are ones that you never had locally; e.g. they were pushed by a coworker. If you did have them locally at one point, force-pushing is a very normal thing to do, e.g. after rebasing. To guard against force-pushing when there are commits that you never saw, use |
Beta Was this translation helpful? Give feedback.
-
|
Is there no lazygit config to disable force pushing globally? |
Beta Was this translation helpful? Give feedback.

I would only agree with this if those remote commits are ones that you never had locally; e.g. they were pushed by a coworker. If you did have them locally at one point, force-pushing is a very normal thing to do, e.g. after rebasing.
To guard against force-pushing when there are commits that you never saw, use
git config --global push.useForceIfIncludes.