Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How can I hide Mercurial closed branches in SourceTree?

Shawn South April 22, 2015

When I close a branch it disappears from the sidebar, but still shows up in the graph. How can I remove my closed branches from the graph? I know I can view just the current branch, but that's not what I want. I'd like to be able to see all open branches without old, closed ones cluttering up the graph.

3 answers

2 votes
Mikhail Belov June 5, 2017

This is pretty old thread as I see, but is there a solution? I've just updated SourceTree from version 1.7 to 2.1.2.4 and it shows every branch ever made. How it can be solved? Except the downgrading back to 1.7, the most stable one?

dcholth June 14, 2017

Same issue in 2.1.2.5.  Just appeared after updating.

Mikhail Belov June 15, 2017

I've downgraded to 2.0.20.1. It does not have this bug.

dcholth June 15, 2017

Its a bug introduced in the latest releases.  Look up their ticket SRCTREEWIN-7189 and upvote it.

timothyp July 18, 2017

Same here

VSquash August 9, 2017

Also have this problem on Windows. Voted in the SRCTREEWIN-7189 ticket: https://jira.atlassian.com/browse/SRCTREEWIN-7189

 

So everytone, please vote in this ticket too. Hope this bug will be fixed soon.

0 votes
piedenis September 27, 2015

I've the same need as Shawn. I've about 50 closed branches (Mercurial) that I want to be got rid of. Could someone answer, please?

0 votes
Johannes Kilian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 22, 2015

"Closing a branch" is not primary a terminology from git itself but rather from branch workflows like gitflow (I assume you are using gitflow within sourcetree,,,).

A  branch in git is simply a lightweight movable pointer on a commit - nothing else. The gitflow-term "closing a branch" consists of two elementary git-steps: 1.) merging the commits (to which the branch pointer currently points to - and previously has been pointing to) into another commit and 2.) removing the pointer. After "closing the branch" the commits (on the "deleted" branch) still exist (they HAVE to exist as hey are part of your commit history - and you surely don't want git to remove anything of your commit history ...) - and only thepointer is removed. That's what you see when looking on the graph.


see:


If you want to cleanup your commit history when merging a branch you have to use more advanced commands like a "squash merge" (on merge all commits of the branch are summarized into one single commit - and this single commit is incorporated into your destination branch (i.e the commit to which the pointer with your destination branchname points to) - all the commits on your branch are removed). Another git command to rewrite your commit history is git rebase.


see:


Be aware that those advanced git concepts are rewritng your commit history - which is always a bad idea if you have previously pushed the commits  ... (you have to perform a "forced push" then - which is considered as evil by many people (http://willi.am/blog/2014/08/12/the-dark-side-of-the-force-push/)

 

 

SUMMARY: "Closing a branch" does not change your commit history - that's what you currently complain about and what you see in your graph.The branch pointer is simply removed - therefore you don't see it anymore in the sourcetree sidebar - and your commits are merged. If you want to modify the commit history, you have to use more advanced git commands - and be aware of potential risks when rewriting an already pushed commit history!!! 

 

Shawn South April 22, 2015

Thanks for the detailed answer, but my question is in regards to Mercurial (which does have a "close branch)" function), not Git.

Like Jeremy Camplin likes this
Johannes Kilian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 22, 2015

No idea about mercurial - sry. Should have read your question better ... ;-)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events