Unable to fetch a remote's branches, nor subsequently delete the remote

As of a few days ago, I can't fetch a remote's branches anymore or rather, they do not display. Steps to reproduce:

  • add a new remote
  • remote shows up in the left sidebar
  • right-click and "fetch from <remote-name>"
  • branches do not display in sidebar
  • however, I do see them appear in the history view

Some similarly weird thing is going on if I then remove that remote, the branches are not removed from history view. Steps to reproduce:

  • in left sidebar, right-click on <remote-name> and select "remove <remote-name>"
  • remote disappears from sidebar
  • branches from remote are still visible in history view

If I go into my ".git/refs/remotes/<remote-name>" folder, I see all its branches still in there, like the History view shows. Clearly, they are not getting deleted. I can remove them manually from the Finder, which then properly reflects in the History view, but it should be working from the UI. And it used to.

 

At the time I was still on SourceTree v2.2.4 and thought that might have been a bug. Didn't remember when I updated it last. So I installed the update to 2.3 with the same issue still. I downgraded a couple versions to v2.2.1 to which I'm certain that it worked with before and I'm still seeing the same issue. Apparently, it's not directly version related. - The only thing I can remember recently doing is installing some npm-modules to that repo. I don't think that this would have any effect but who knows.

 

Has anyone run into this issue before or has a suggestion on how to resolve this?

3 answers

1 accepted

I think I just resolved it. The steps I took:

  • quit SourceTree
  • removed all previously added remote folders through the Finder from both ".git/refs/remotes/" and ".git/logs/refs/remotes/" (kept only origin and upstream remotes)
  • relaunched SourceTree
  • added a remote again, fetched and the branches showed up
  • removed the remote and it removed all its branches as well
  • this now works on v2.3 as well

Still not sure what initially caused this but it seems to be resolved... for now. Will keep an eye on it.

Is the behavior any different if you use git commands to remove the remote?

@Seth Good question, just tried that and no, it's actually the same behavior. The remote gets properly removed but not its branches. Hmm...

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

557 views 1 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you