It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

2 votes
Answer 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.

Like # people like this

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

Like # people like this

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. 

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
TAGS
Community showcase
Published in Sourcetree

Sourcetree for Windows - CVE-2019-11582 - Remote Code Execution vulnerability

A vulnerability has been published today in regards to Sourcetree for Windows.  The goal of this article is to give you a summary of information we have gathered from Atlassian Community as a st...

4,989 views 0 12
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you