One Git repository, multiple checkouts?

My product is large, with many active release branches.  For this, I have many Eclipse workspaces, each with the source code from its release branch.  I cannot use a single workspace, then "switch" release branches within it.

I would like to create a single local Git repository, which connects to a remote Git repository.  Then, each of my workspaces checks out the code for its release branch, from the local repository.  I would like to avoid creating a local repository for each release branch.

Is this possible?  Does SourceTree support this?  How?  I don't see how it can be done in the SourceTree UI.

1 answer

0 vote


If I understand correctly you woudl like to have one local clone of the remote repository, and then have your indvidual workspaces using a single branch checked out from the local repository?

If this understanding is correct I think you might want to look at git worktree

This can give you mulitple working copies but without duplicating the full git repo locally.

SourceTree does not explicitly support the worktree functionality, but you can open each additional worktree in SourceTree and use it as a valid repo in its own right. This saves space with respect to multiple clones of the origin repo. 

Suggest an answer

Log in or Join to answer
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

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

274 views 0 3
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot