You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I usually work on a branch and I do a lot of commits with --amend or changing the order of commits or editing previous commits, which leads to requiring a force push. Usually I'm the only one who works on that branch, but sometimes my teammates do a single commit on that branch, which we might forget to talk about. As I usually force push a lot, I don't look at fetch status of how many commits are changed on the remote and I might force push their changes.
Outside lazy git people usually use git push --force-with-lease which helps with this. Then they fetch and read the changes, and they can force push again. But in lazygit as it automatically fetches in the background, the --force-with-lease becomes useless, and it behaves like --force when a fetch has happened.
Describe the solution you'd like
Use git push --force-with-lease --force-if-includes as default, and it won't force push other people changes. Also add another commit without --force-if-include for other situations that we actually want to ignore other remote commits. Or ask in another dialog if we want to ignore their changes.
I think it's also a safer option, as lazygit fetches periodically by itself (and git don't).
The text was updated successfully, but these errors were encountered:
Oh great, sorry, completely forget to search in previous issues.
I think this issue is not going to stop repeating in GitHub issues because the combination of auto fetching and --force-with-lease makes things weird. At first, I didn't expect to force push on my teammate commits because I could see in the bottom right side of lazygit that it's using --force-with-lease and I didn't notice the auto fetch.
Maybe adding a more comprehensive message in the force push warning dialog would be helpful? Or suggest people to turn on this global option somewhere?
Another thing is that I might not always want to have that global config. Tool level (lazygit) configuration for this can be beneficial.
Is your feature request related to a problem? Please describe.
I usually work on a branch and I do a lot of commits with
--amend
or changing the order of commits or editing previous commits, which leads to requiring a force push. Usually I'm the only one who works on that branch, but sometimes my teammates do a single commit on that branch, which we might forget to talk about. As I usually force push a lot, I don't look at fetch status of how many commits are changed on the remote and I might force push their changes.Outside lazy git people usually use
git push --force-with-lease
which helps with this. Then they fetch and read the changes, and they can force push again. But in lazygit as it automatically fetches in the background, the--force-with-lease
becomes useless, and it behaves like--force
when a fetch has happened.Describe the solution you'd like
Use
git push --force-with-lease --force-if-includes
as default, and it won't force push other people changes. Also add another commit without--force-if-include
for other situations that we actually want to ignore other remote commits. Or ask in another dialog if we want to ignore their changes.I think it's also a safer option, as lazygit fetches periodically by itself (and git don't).
The text was updated successfully, but these errors were encountered: