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

One Git repository, multiple checkouts?

Deleted user May 12, 2017

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 votes
minnsey
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 22, 2017

Hi

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 https://git-scm.com/docs/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 Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events