Setting up active branches in SourceTree and GitBucket

Hello Community.

I'm trying to set up branches so that when my employees first clone the repository they have all the branches available. This is how I want to set it up:

Have the Master branch that they don't and/or can't mess with. I'll be the one that syncs up working versions to that branch. Kind of like the release versions. We don't work out of the Master just in case something breaks we have a back up.  But I want a development branch as a parent to development.username branch. They work in development.username (each will have a unique username) and they all sync their work to development when they've completed a task. The development branch will later be synced up to Master branch.

What I'm having trouble doing is getting the branches to show up in SourceTree automatically so that they don't have to set them up. I'm trying to make it as easy as possible for them. Every time I clone the repository only the main branch is showing up, as main branch (whatever that branch was set to be; development, master, etc.) is the only active branch in GitBucket. I've worked under someone that set up SourceTree like this so I know it's possible. I just can't seem to figure it out or find more recent tutorials on branches.  Unless I'm not remembering correctly, I'm pretty sure I worked under someone who did just that.

How would I accomplish what I'm trying to do?

1 answer

I don't think there's an easy way to make SourceTree actually clone down all the branches - that's not standard Git behavior and there's not even an easy way to do it in Git, really - but you can make sure that you've enabled the "Show Remote Branches" option which will at least then show that the remote branches exist - and allow your developers to easily pull them down by double clicking on them.

Here, I have a fresh-cloned repo.  The only branch I have actually have locally is master.


Screen Shot 2015-12-04 at 10.11.25 AM.png

But within SourceTree, I've enabled "Show Remote Branches", so I can see that feature/a exists remotely

Screen Shot 2015-12-04 at 10.10.41 AM.png

I double click on it and I can easily pull it, creating a local tracking branch, and check it out at the same time:

Screen Shot 2015-12-04 at 10.10.58 AM.png

Now I have a local copy of that branch:

Screen Shot 2015-12-04 at 10.11.38 AM.png

Thanks for the reply. Yeah, Show Remote Branches was set as the default. So I'm guessing it means I'll have to have each of them set up their local SourceTree individually?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 23, 2018 in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

1,207 views 4 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