git question with two branches and local copies

i explain my problem-thougt: i have created on my remote repo ( kalwalt/ofxOpenSceneGraph) in github a new branch (pull-request-007-linux-branch) in which i do all experimental things. Now i have this in my mind: how i can in my local copy separate the two branches? what is the best solution? Do i create two separate folder for the two branches? but in this way how git recognize the differences? Briefly how do you organize git and your local copy with different branches with your local copies?
thank you in advance

I have to admit I don’t really get the question, but have you already read this: https://github.com/openframeworks/openFrameworks/wiki/openFrameworks-git-workflow ?
In the end of the page, there is a list of resources for git beginners. If you read at least the github help page and gitref, things should be much clearer already.

If your question remains after doing this, come back here. :slight_smile:

Thank you for the reply @bilderbuchi, there are a lot of resources in that link, but my doubts remains. what is best done if you have two branches and you want to keep on your computer the two separated branches? Is it possible or i need another approach to git?

git keeps branches completely separate. If you want to switch to your other branch, just check it out again via git checkout name-of-first-branch.

and to clarify sth’s answer even more: both branches live in the same repository, so you don’t need any copied folders or anything. all the info for all branches is stored in the repo (in the .git folder, to be precise), and the contents of the repo (folders, files, etc) reflect the currently active branch, that is the one you have currently “checked out”.

a bit more advanced info:
If you made your local repo by cloning your github repo (and that’s really the most convenient way), you already have a so-called “remote” named origin there - this is the github repo. you can verify this by executing “git remote -v” in your shell.
if yuo don’t have that, you can create this via “git remote add origin git@github.com:kalwalt/ofxOpenSceneGraph.git”

if you want to pull down your new branch, you say “git fetch origin pull-request-007-linux-branch”. then you should be able to check out the new branch with “git checkout pull-request-007-linux-branch”.

Thanks for everybody answers, i think that now the git process in this case is clearer for me.!