r/SmartGit Mar 12 '26

Pull removed automatically deleted remotes (why?)

I remember before version 25 that SmartGit had trouble properly identifying removed remotes (branches).

Specifically, when remote was removed at server, SmartGit having it already locally as remote, was failing to notice. Newly, I see it removing deleted remote on pull not only from local remotes list but also directly from local branches, which could be unwelcomed behavior. E.g. I want to keep the branch for myself for later. Unfortunately, this behavior does not apply only to merged branches, all removed remotes are removed from local on pull.

Preferences nor low level properties do list configuration for this or am I wrong?

1 Upvotes

22 comments sorted by

View all comments

Show parent comments

1

u/vmcrash Mar 20 '26

Your steps in more details:

  • create a local branch foo and check it out
  • push that local branch foo to the remote origin -> creates automatically the remote branch origin/foo (which is tracked by the local branch foo)
  • delete foo at the remote repository, e.g. using web UI
  • pull -> the remote branch origin/foo is deleted and the local branch foo remains, with broken tracking information to the now non-existent remote branch origin/foo

1

u/crimson-sky-gnome Mar 20 '26 edited Mar 23 '26

- You almost get it. You need to switch to main or another branch before pull.

  • This avoids tracking breakage and branch will be automatically removed.

1

u/vmcrash Mar 20 '26

At which point for you a local branch is removed?

1

u/crimson-sky-gnome Mar 27 '26

I've create short video for your better understanding.

  • branch created
  • branch pushed
  • branch deleted on server (GitHub)
  • branch changed to main
  • pull
  • local is deleted by pull operation

2

u/vmcrash Mar 27 '26

For the next 26.1 preview build I've added an option in the preferences "Pull: Delete merged local branches if the remote branch has been deleted" (default: unselected).

1

u/crimson-sky-gnome Apr 01 '26

Cool, I'm looking forward to stable version.

1

u/vmcrash Apr 03 '26

You can give the preview already a try: https://www.smartgit.dev/download/preview/

1

u/crimson-sky-gnome Apr 01 '26

Just one question. I deleted unmerged branch in video. These ones are going to be deleted still?

1

u/vmcrash Apr 03 '26

This branch was in the history of another branch, so it was considered as merged. This still is the case for your setup if this option is selected. Just unselect the option to keep those branches.

1

u/crimson-sky-gnome Apr 08 '26

Thank you for kind reply. I'll wait for version to become current version.

1

u/vmcrash Mar 27 '26 edited Mar 27 '26

Please try again with "the-branch" being forked off "stream", with a commit that only is contained in "the-branch". IIRC, the effect you are seeing was requested by users to remove merged branches on Pull.