Hi,
I've been using sourcetree for some time now, and it's great.
There is one issue that is a constant headache when managing branches though: sourcetree does not correctly update the remote branch statuses, even if you select "Refresh Remote Status".
The setup we are using is with a remote Git repository running on Stash, connecting over a VPN.
Steps to reproduce:
- create a branch locally
- push to origin
- pull on another machine (or machines)
- delete the origin branch on any machine (lets call this machine 'A')
- select "Refresh Remote Status" on any other machine (anything but 'A')
- observe that the deleted branch does not disappear from the list of branches on the remote repo
Subsequently, if you delete the remote branch (from any machine other than 'A')
- observe these errors
error: unable to delete '<branch>': remote ref does not exist
error: failed to push some refs to '<repo>'
This is an issue for me both in the latest Mac client (v 1.9.7) and the latest Windows client (v 1.5.2.0), and for my colleagues who see the same issue.
I note that searching 'answers' throws up a number of discussions of similar issues with refreshing remote status, at least one of which refers to this exact problem in the comments:
https://answers.atlassian.com/questions/237303/auto-refresh-of-remote-status-in-sourcetree-not-working
https://answers.atlassian.com/questions/214369/how-do-i-see-remote-activity-refresh-remote-status-doesn-t-seem-to-do-anything
https://answers.atlassian.com/questions/47459/please-make-sourcetree-automatically-refresh-the-remote-status-on-opening-a-repo
In particular the comments from Piotr Hlawski and Cory Simmons in the first link suggest I am not the only person seeing this problem, and that it has been present for a while.
Can you confirm that this is a known issue ?
Thanks !
Community moderators have prevented the ability to post new answers.
It turns out that this is not a bug, it's by design.
I still don't feel the manual 'Refresh Remote Status' option is particuarly clear to someone coming to this as a new user however, as I discuss in the comments here:
https://jira.atlassian.com/browse/SRCTREE-2604
I tested the following now:
This looks like a bug. You can report it here. I will upvote it if you paste the link here. :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
[Assuming that "Refresh Remote Status" above means Tools/Options/Check default remotes for updates every x minutes.]
The background checking of remotes uses the fetch command, which by default does not change your refs other than adding new ones. If you press the Fetch button, you can see an option in the dialog called "Prune tracking branches no longer present on remote(s)", which adds the --prune switch to the fetch command. This will remove the deleted branches from the list.
I guess the reason for the background fetch to not use this switch is that this is the safe option. (e.g. if someone accidentally deletes the branch on the server, it can be re-pushed form the clients, but only if it still exists there.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Balazs, no, "Refresh Remote Status" in my question refers to explicitly selecting "Repository->Refresh Remote Status" from the menu.
Also, I don't want to prune any local branches if a remote branch has been deleted, as you note, that's not a 'safe' operation.
I am just interested in knowing the status of the remote branches (display them if they exist, do not display if they no longer exist!!).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This does the same as the "every x minutes" option, but only once.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.