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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Is it possible to have 2 local folders, each containing a different branch of the same repository?

I have 2 branches of a project (A & B). I want to show the client 2 directions we could take the project in. I seem to only be able to switch the 1 project folder between the branches.

What I need is the ability to have a 2nd, completely different folder contain branch B.

1 folder for branch A - 1 folder for branch B.

That way I can show 1 thing on branch A then show the equivalent thing on branch B and have them side by side. With the current 1 folder - either A-mode or B-mode - I can't achieve this.

I don't want to switch branches within the existing folder. I want to keep branch A in the A folder then check out branch B into the B folder.

Is this possible?

2 answers

1 accepted

4 votes
Answer accepted
KieranA Rising Star Apr 23, 2013

Hi Maurice,

Sure, we do this all the time. For SourceTree I run two branches, one for the default branch (most recent changes) and one for specific versions such as 1.5.8.

All you have to do is checkout your repository twice (or copy one folder). So in my file system I have two folders in the same directory, one called "SourceTree" and the other "SourceTreeDefault" each of which has SourceTree checked out into them. This way, I can run two instances of the same application at the same time if I want to. In each folder I have a different branch checked out. Remember that checking out a branch has nothing really to do with the remote, it's to do with your local working copy and what you've chosen to checkout.

Remember that anything which is committed and pushed in one of the repo's will be pullable in the other anyway, so they can stay in sync.

If I were you, I'd just checkout your remote to another folder in the same parent directory as your existing repository (with a different repo/folder name), then just run both projects by whatever means you're displaying them. If it's a web server you can specify a port to run them on, and if it's an application then two instances would run anyway.

Hope that helps.

Thanks Keiran

If I were you, I'd just checkout your remote to another folder in the same parent directory as your existing repository (with a different repo/folder name)

I eventually realized I could do this. I was hoping there was a way to just duplicate the existing working copy folder without needing to download the files from the remote origin again.

Does this look like what you've described or is there some other way that doesn't involving having to download everything all over again?

Like abhishek_madhu likes this

I know this is an old question but there is a better way to do this now. See this link. It describes briefly how to use "git worktree". AFAIK Sourtree doesn't have any support for worktrees yet.

The original context is about a temporary demo. To me the obvious simple solution is to copy the working folder in file explorer and then in Sourcetree switch the working folder to the other branch. Discard the copy after demo.

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events