search

Home  >  Q&A  >  body text

How to initialize git?

I built a project on github and there is code locally. I initialized it with git init locally. How do I submit the local code to github?

伊谢尔伦伊谢尔伦2793 days ago615

reply all(4)I'll reply

  • 阿神

    阿神2017-05-02 09:26:31

    Please see the help https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/

    reply
    0
  • 迷茫

    迷茫2017-05-02 09:26:31

    Click on your project link on github. If it is empty, there will be detailedsteps

    reply
    0
  • 滿天的星座

    滿天的星座2017-05-02 09:26:31

    1 Generate ssh-key locally: ssh-keygen -t rsa -C "$userEmail"
    2 Paste the public key in the github account
    3 Add remote library locally: git remote add origin git@xxxxx.git
    4 Test whether it is successful - ->Commit a file, then push it to see if it is available on github

    5 When connecting to other github libraries on this computer in the future, steps 1 and 2 will be omitted

    reply
    0
  • 習慣沉默

    習慣沉默2017-05-02 09:26:31

    1 Generate the secret locally: $ ssh-keygen -t rsa -C "youremail@example.com"
    2 Then cd .ssh into the folder vim id_rsa.pub and paste the secret into github (located in "Account settings", "SSH Keys" page)
    3 Associate local and remote trousers (note to modify the address): $ git remote add origin git@github.com:michaelliao/learngit.git
    4 $ git push -u origin master
    5 Push directly in the future Use command: $ git push origin master

    reply
    0
  • Cancelreply