开发者

Github: how to checkout my own repository

开发者 https://www.devze.com 2023-03-06 03:24 出处:网络
I am very new t开发者_StackOverflowo GitHub. I have created a GitHub repository and pushed it from my computer.

I am very new t开发者_StackOverflowo 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.


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

Github: how to checkout my own repository

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


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:

  • http://progit.org/book/ch2-1.html#cloning_an_existing_repository
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号