Skip to content

Add "Commit & Force Push" action when amending a commit #2575

Description

@sophiadeveloper

Description

When working in Local Changes, SourceGit normally provides both:

  • Commit
  • Commit & Push

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:

  • Commit & Force Push

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:

  1. amend the commit;
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions