81

I am very new to GitHub.

I have created a GitHub repository and pushed it from my computer.

Now I need to work on it from another computer.

How can I checkout my own repository? Should I fork it as for other people's repositories?
It seems to me a bit silly to fork my own repository, though.

2 Answers 2

127

On the project page (http://github.com/you/project) there will be a link on the right at the bottom of project tools list with a path to a .git repo

git url new site layout

Open a terminal and type:

git clone [link to repo here]

That will create a local clone of the repo you can work on, then if you follow the instructions on GitHub to add a remote server you can push your changes back.

Syncing files back and forwards is just as easy;

Computer A (Had the original git repo)
Computer B (Has the cloned repo)

Make some changes on Computer A, then run

git push origin master

Go to computer B, then run

git pull origin master

To sync your new changes, make some changes on computer B then push back

git push origin master
1
  • 1
    You might want to read up on basic git commands at gitref.org. After that, if you want to dig further into the more advanced commands, check out progit.org.
    – Tekkub
    May 13, 2011 at 10:33
5

You don't need to fork it on the site, you can just clone your repository. There are links on your repository's page for cloning it with the SSH, git, or HTTP protocols. (Since it's your own, you probably want the SSH one.)

Information about how to clone a repository will come up very early in any git tutorial, so I'm not sure it's worth adding much more here - you might want to start with the one in Pro Git, for example:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.