It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Multiple working trees?

Is it possible to have two separate branches of the same repository open at the same time? I'd like to have an Xcode project open from one branch and the same Xcode project open but from another branch at the same time. So it would seem to me I would need two bookmarks specified. Both would point to the same repository but would allow me to work on two different branches of the same repository at the same time. Is this correct?

1 answer

1 accepted

0 votes
Answer accepted

Hey dkb,

We actually do this ourselves here to save switching branches. The way to do it is checkout multiple copies of your project, but each folder in your file system having different branches checked out. So essentially the same repository checked out multiple times to different locations. You can name the bookmark whatever you want which will give it the folder name to reflect the bookmark name allowing you to tell the difference. So for SourceTree we could give it names such as SourceTree_1_4 to indicate version 1.4. In Xcode you can quickly find out what version you're on (because it will just tell you your project name) by cmd + clicking on the very top middle where the project name is, and it will tell you the location of your project.

Hope that helps

Thanks. That answers my question perfectly. I wonder if there isn't a new feature lurking here. This concept could be better integrated into SourceTree. The ability for SourceTree to handle creation and switching between "independent" working trees.

The bookmarks reflect paths. I can see where you're going for hot-swapping between branches, but usually if you're doing that you need to do an update anyway as there's typically changes in other branches. Plus, the line between updating to a branch and switching between different directories becomes very blurred and can make it more confusing for the user. SourceTree reflects what Git/Mercurial does, and if we did what you suggested then it wouldn't be reflecting that functionality. Good idea otherwise though, it's just Git/Mercurial isn't designed to do this kind of thing :)

Git now provides a MUCH better way to do this and I would LOVE to see SourceTree support it.

Right now, I haven't the foggiest I deal what SourceTree is going to "see" if I create a second working tree.    I'd like to think it's exactly what I'd see today if there wasn't a second working tree.   That would be safe - but it would mean that I couldn't use SourceTree in the second working tree.

https://stacktoheap.com/blog/2016/01/19/using-multiple-worktrees-with-git/

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Sourcetree

Sourcetree for Windows - CVE-2019-11582 - Remote Code Execution vulnerability

A vulnerability has been published today in regards to Sourcetree for Windows.  The goal of this article is to give you a summary of information we have gathered from Atlassian Community as a st...

4,895 views 0 12
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you