Skip to content

enhance: worktree and branch UI improvements, rename remote branch, remove tracking reference#2346

Open
briepala wants to merge 6 commits into
sourcegit-scm:masterfrom
briepala:branch/workspaces-handler-fowx0
Open

enhance: worktree and branch UI improvements, rename remote branch, remove tracking reference#2346
briepala wants to merge 6 commits into
sourcegit-scm:masterfrom
briepala:branch/workspaces-handler-fowx0

Conversation

@briepala
Copy link
Copy Markdown

Summary

Branch Operations

Rename remote branch: New "Rename..." context menu on remote branches opens a popup that pushes the current commit to a new branch name on the remote, deletes the old one, and updates the tracking of any local branches that tracked the old remote branch.

Remove tracking reference: New "Remove Tracking Reference" context menu item on local branches that have an upstream set. Calls git branch --unset-upstream directly.

Rename local branch with remote: Checkbox "Also rename remote branch" in the rename dialog. Fixes:

  • Correctly deletes the actual remote branch name (not the local branch name) when they differ
  • Pushes the tracking remote's HEAD commit rather than the local ref
  • Updates the local branch's upstream tracking to the new remote branch
  • Checkbox is disabled when local and remote branches are at different commits (CanRenameRemote guard)

Delete remote branch: When deleting a remote branch directly, all local branches that were tracking it get their upstream unset automatically.

Delete branch with worktree: Confirmation checkbox to force-remove the worktree before deleting the branch (avoids git's rejection of deleting a branch checked out in a worktree).

Toolbar

  • Repository folder name shown in bold to the left of the current branch name.
  • New Branch and Worktree toolbar buttons for quick access to create-branch and add-worktree dialogs.
  • All 7 action buttons (Fetch, Pull, Push, Stash, Apply, Branch, Worktree) display text labels beneath their icons.

Localization

  • New resource strings added to en_US and all translated locale files.

@love-linger
Copy link
Copy Markdown
Collaborator

First of all, keep your PR focus on a single issue.

Remove tracking reference

It's not necessary. You can change the upstream from Set Tracking Branch... even if you want to unset it

Rename remote branch

There's no plan to add this feature to SourceGit. If you want, I recommand you to add a custom action with a user script to do this.

I want all the SourceGit users to know that we can not rename a remote branch. We can just push a new one and delete the old one (if it is needed). At the same time, in some collaborative projects, deleting a remote branch may require additional operations. For example, it may be necessary to lock the remote branch first to ensure that no new commits are pushed to this remote branch during the deletion process.

Delete branch with worktree

I'd like to let user's know why this branch can not be deleted directly.

Toolbar - Repository folder name shown in bold to the left of the current branch name.

Not planed. If you have more than one repositories that have the same name, you can rename it in SourceGit (using context menu of repository tab) which will not change the folder name but give a friendly name displayed in tabs

Toolbar - New Branch and Worktree toolbar buttons for quick access to create-branch and add-worktree dialogs.

Not planned. In fact, I just removed the New Branch button from toolbar since v2026.07. See #2245

Toolbar - All 7 action buttons (Fetch, Pull, Push, Stash, Apply, Branch, Worktree) display text labels beneath their icons.

Not planned. I've removed the button labels since v4.9 (2021/08/13)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants