jesseduffield / jesseduffield/lazygit
Change default force push strategy
- Dominant language
- Go
- Stars
- 82.4k
- Forks
- 3k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 19
Description
**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).
Contributor guide
Assessment
This issue has not been assessed yet.