gittortoisegitrcs

TortoiseGit - Git Clone


Can I use a "Git Clone" like a branch? I get the feeling not, but I am totally new to Git so I will ask (since do not see answer elsewhere). What I mean, is if I do a "Git Clone", work on that source code for a while, do another "Git Clone" of same source folder to different destination, work on that and subsequently can I commit / push both destination folders of code successfully? Both of these folders have the same source folder, just done with "Git Clone" at different times. In other words, is TortoiseGit smart enough to figure out the merging, etc.?

Thanks,

Buck


Solution

  • You can do that, although I think you would have to pull first, merge locally and then push the changes in order to merge them. But you can also use actual branching, which is similar.

    Advantage of 'real' branching is that you don't have to have two complete clones (in addition to some additional advantages depending on how you use it).

    The disadvantage is that you have to toggle between branches if you want to switch working on them, so you cannot work on two branches on the same clone at the same time. Also, any uncommitted changes also shift to the other branch, unless they collide with changes made there, in which case you have to stash those changes. Anyway, a 'quick' toggle to a different branch isn't as easy as you'd hope.