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?
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
Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...
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!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG