Github: how to checkout my own repository

前端 未结 2 380
情书的邮戳
情书的邮戳 2021-01-29 21:50

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 che

相关标签:
2条回答
  • 2021-01-29 22:16

    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 讨论(0)
  • 2021-01-29 22:41

    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
    
    0 讨论(0)
提交回复
热议问题