Skip to content

Does lazygit use --force or --force-with-lease while force pushing commit? #4068

Answered by stefanhaller
byteZorvin asked this question in Q&A
Discussion options

You must be logged in to vote

It is safer to use --force-with-lease

No, it is not, at least not when used on its own. I have been trying to combat this misinformation for a long time now. When used on its own, --force-with-lease provides very little additional protection over --force. See the link that Luka posted above for more information.

But yes, lazygit does use --force-with-lease, and it is strongly recommended that you also turn on git config --global push.useForceIfIncludes true to make it actually safe.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@byteZorvin
Comment options

@stefanhaller
Comment options

@byteZorvin
Comment options

Answer selected by byteZorvin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants