Skip to content

feature: add "Commit & Force Push" action when amending a commit - #2631

Open
sdpfigueiredo wants to merge 1 commit into
sourcegit-scm:developfrom
sdpfigueiredo:feat/commit-and-force-push
Open

feature: add "Commit & Force Push" action when amending a commit#2631
sdpfigueiredo wants to merge 1 commit into
sourcegit-scm:developfrom
sdpfigueiredo:feat/commit-and-force-push

Conversation

@sdpfigueiredo

Copy link
Copy Markdown

Closes#2575

Description

Implements the requested Commit & Force Push action in the Local Changes panel, making the amend workflow consistent with the existing Commit & Push workflow.

  • The Commit & Push button is now a SplitButton with a dropdown offering two actions:
    • Commit & Push — unchanged behavior
    • Commit & Force Push
  • Selecting Commit & Force Push first shows a confirmation dialog warning that the remote branch history will be rewritten.
  • After confirmation, the commit is created and pushed via the existing push machinery with --force-with-lease, so concurrent remote changes by other users are never overwritten blindly (per the issue's safety requirement).

Notes

  • The dropdown is visible whenever the repository has remotes, so the action works both with and without the Amend checkbox — it matters most when Amend is enabled, since rewriting an already-pushed commit requires a force push.
  • New localization keys were added to en_US.axaml; all other locales fall back to it via ResourceInclude.

Testing

  • dotnet build src/SourceGit.csproj -c Debug — 0 warnings, 0 errors
  • dotnet publish src/SourceGit.csproj -c Release -r win-x64 — Native AOT publish succeeds
  • Smoke-tested the published Windows x64 build

Screenshot

image

Turn the commit-and-push button into a SplitButton with a dropdown item that commits and force pushes when amend is enabled, and add the related localization keys.
@sdpfigueiredo
sdpfigueiredo changed the base branch from master to developAugust 17, 2026 18:10
@love-linger

Copy link
Copy Markdown
Collaborator

Force Push is a dangerous operation. SourceGit requires user to manually push with --force enabled.

@love-lingerlove-linger self-assigned this Aug 18, 2026
@love-lingerlove-linger added the not-planned It's not planned in the future label Aug 18, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

not-plannedIt's not planned in the future

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants

@sdpfigueiredo@love-linger