Clone repository into GitHub

后端 未结 3 1155
无人共我
无人共我 2020-12-24 13:54

I have been using git locally for while a now and have a private repository with complete change history etc. I now want to share this on GitHub, so I need to clone from my

相关标签:
3条回答
  • 2020-12-24 14:03

    You do this by pushing to remote repo on GitHub. You should get the whole history and everything.

    0 讨论(0)
  • 2020-12-24 14:11

    You simply want to create a new repository on your account on GitHub. Assuming your account name is CraigH, and you call you new repository NewRepo (imaginative, I know), you'd simply (assuming you have GitHub keys set up on your system properly):

    1. Add a remote to your local repository
      • git remote add origin git@github.com:CraigH/NewRepo.git
    2. Push out your current history to GitHub
      • git push --set-upstream origin master

    And from that point, your history in the master branch are in GitHub's master branch.

    0 讨论(0)
  • 2020-12-24 14:22

    You don't need to "clone onto GitHub". You just have to create a repository on GitHub and push your changes there:

    $ cd your_local_repo
    $ git remote add origin git@github.com:USERNAME/REPO_NAME.git
    $ git push origin master
    
    0 讨论(0)
提交回复
热议问题