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?
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.