Is there a way to control the order of branches shown in the graph in SourceTree?

I'm using GitFlow, and it sure seems like it would be a more intuitive ordering of the lines in the graph in SourceTree if the left-most line were always 'master', after that any 'hotfix' branches, then the 'release' branch (if present), then 'develop', followed (right-most) by any 'feature' branches.

I know this is a trivial benefit that would probably require significantly complicated programming on Atlassian's part and is therefore probably not worth the effort.  However, it would be awfully nice, so it seemed worth asking just in case there is already some way to achieve this result (or something similar).

4 answers

1 accepted

Your request would make sense, if gitflow would be the "one-and-only" branching model. If this ever would be implemented (which iI doubt), it should be optional - as there a few other branching models (and as some people might already be comfortable with the current situation wink)

SourceTree uses the common way of visualizing git-logs. The dynamic ordering of branches has been asked and discussed here on this site many times already.

You might have a look here:

 

 

That makes sense, thanks. And I agree: it should be optional. Maybe a simpler request would be to let people define some strings to match against to control the colors of the various branches. For example, I could then set SourceTree to always make the "master" branch blue, and any branches starting with "feature" yellow, etc. Anyway, thanks for the explanation and links.

Sure, it should be optional, but I think that putting the master branch always on the left would be useful for GitHub Flow, too.  I'm not sure what strategies is would be harmful to

git does not have any preferred branch - any branch is equivalent. Even master is not an extraordinary branch - it has its extraordinary meaning only by convention. The main branch has not to be named "master" - If I establish (only by personal convention) to have a branch named "Garbage" to be the main branch, branch "master" has not even to be available.

So I think it would be better not to have the branch named "master" to be the main branch, but rather to have a possibility in SourceTree to define the Standard-Branch. This standard branch should be treated specially (for example: to be configurable to be shown "always on the left" in the graph - but this should be optional)

BTW: BitbucketServer allows to define a "Standard Branch" per repository

Can we achieve custom sort oder with git branch --sort somehow?SO it can be easilly adjusted?

 

That is a wonderfull suggestion. There already is an option to choose branch odering. But gitflow ordering is not in the list. As SourceTree supports gitflow workflow it would be nice to make it look as it is natural to the methodology. Please consider implementing it!

 

I wish it existed as an option, too.  But I think you hit the nail on the head in terms of coding complexity to payoff, from Atlassian's point-of-view, because SourceTree pretty much just uses git's branch graphing logic without altering it, and to git a branch is a branch is a branch.

Still, if you want to make the suggestion to Atlassian, the proper place to do that is jira.atlassian.com - where I expect you might find existing feature requests you could vote for. 

0 vote

This. Due to 3rd party repo integrations, much of the Git workflow is migrating to feature branching of some flavor.

Master is the de-facto branch in these workflows. Having it float all over the place is hard to manage.

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...

556 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