Hi,
I'm new to SourceTree. I would like cloning (on my local workstation) different branches (master and develop) from the same remote repo. How can I do this in SourceTree?
Thanks.
Guy
You don't clone a branch, you clone the entire repository. Once you have a local repo, you can "check out" one branch at a time, but can switch as frequently as you want with or without access to the remote.
If you need to have working copies for two different branches at the same time, you'll need two local repositories. You can either have both clone the same remote repository to different local locations, or you can have your second local repo clone your first.
Hi Seth,
Thanks.
I performed "Clone from URL" and I get a copy (folders/files) of the "master" branch in my local git folder. In the "SourceTree" window I see: under BRANCHES master and under REMOTES develop - HEAD - master.
When I now right-click "develop" and select "Checkout" I see in my "SourceTree" window under BRANCHES develop and master; but I don't see in my local git repository adding any files of the develop branche?
My intentions are: not changing the source code from the remote repo but I would like having the code of the different branches locally (for local use in another app)?
Thanks.
Guy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When you check out a different branch, the files in your local folder should change, unless the contents of the two branches are identical. If that isn't happening, there may be something wrong with your local git setup. Compare the branches and identify one difference that should exist between the two, then check for that after checking out each branch. I still don't really understand what you're going for, but I don't need to. If you need access to both branches at the SAME TIME, you NEED two repositories. Otherwise, alternating checkouts should be sufficient.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My intentions are: not changing the source code from the remote repo but I would like having the code of the different branches locally (for local use in another app)?
I suppose I need to use your 2nd option:
If you need to have working copies for two different branches at the same time, you'll need two local repositories. You can either have both clone the same remote repository to different local locations, or you can have your second local repo clone your first.
Ok it works now. I created two repo clones the master branche called "abc-master" and the develop branche called "abc-develop". Both folders are now in my local git folder.
Thanks.
Guy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.