Github Git remote library connected to the local library

Github Git remote library connected to the local library

  • Creating SSH Key

    • With a user's home directory .ssh-> id_rsaand id_rae.pub-> skip
    • If no -> ssh-keygen -t rsa -C["邮件地址"]-> Enter the bin
    • The id_rsa.pubcopy and paste the contents into the Github-> Account settings-> SSH Keys->Add SSH Hey
  • Adding remote libraries

    • 本地Git仓库-->远程Github仓库
    • Create a new repository on Github ->Create repository
    • git remote add [别名][仓库地址]-> Alias ​​generally origin
    • git remote -v-> You can view all current remote address aliases
    • This is about uploading with https way, each will verify the account password, it would be more trouble, you can refer to the following solutions.
  • Push file

    • git push [别名][分支名]

    • Github commit code the user name and password:

      • Default https: Account: user.email

        Password: token

      • Workaround -> Convert to SSH

        1. git remote -vCheck what way

        2. git remote rm originremove https ssh way into fashion

        3. Copy the ssh address.

        4.git remote add origin [复制的地址]

        5. git remote -vCheck whether the change is successful

        6. git push origin masterresubmit

  • Clone file

    • git clone [远程地址]
      • The remotely downloaded to the local library
      • Create a remote origin address alias
      • Initialize the local library

Guess you like

Origin www.cnblogs.com/summerday152/p/11790052.html