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

Setting up active branches in SourceTree and GitBucket

Drew December 4, 2015

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

0 votes
Tim Crall
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.
December 4, 2015

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

Drew December 7, 2015

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
TAGS
AUG Leaders

Atlassian Community Events