Description
When working in Local Changes, SourceGit normally provides both:
However, when the Amend option is enabled, only the Commit action remains available.
Since amending an already pushed commit usually requires rewriting the remote branch, it would be useful to provide an additional action:
For safety, this action should preferably use git push --force-with-lease rather than an unconditional --force.
Expected behavior
When Amend is enabled:
- keep the existing
Commit action;
- provide a
Commit & Force Push action;
- optionally display a confirmation dialog explaining that the remote branch history will be rewritten;
- use
--force-with-lease to avoid overwriting remote changes made by other users.
Motivation
The current workflow requires two separate operations:
- amend the commit;
- manually perform a force push afterward.
Adding this action would make the amend workflow consistent with the existing Commit & Push workflow while retaining appropriate safety checks.
Related discussion: #2379
Description
When working in Local Changes, SourceGit normally provides both:
CommitCommit & PushHowever, when the Amend option is enabled, only the
Commitaction remains available.Since amending an already pushed commit usually requires rewriting the remote branch, it would be useful to provide an additional action:
Commit & Force PushFor safety, this action should preferably use
git push --force-with-leaserather than an unconditional--force.Expected behavior
When Amend is enabled:
Commitaction;Commit & Force Pushaction;--force-with-leaseto avoid overwriting remote changes made by other users.Motivation
The current workflow requires two separate operations:
Adding this action would make the amend workflow consistent with the existing
Commit & Pushworkflow while retaining appropriate safety checks.Related discussion: #2379