github environment configuration

what is github?

GitHub is a code hosting platform for programmers and an open source distributed version control system based on git. However, when you log on to the github official website, it does not prepare a good code uploading system for you, because it is a distributed version management system based on git. So, how to upload local code to github faster and more efficiently? First, we need to install git locally, so that we can use the git command line in the local environment, (for example: $ git add index.html) Second, we need to connect to your github account, so that you can upload your code files. , and each change will form a version record, which is very helpful for team collaboration.

git environment construction

  • Of course, first you need to register a github account.
  • Install the git client
  • Configure account information
  • create local ssh
    • This is a method of transferring codes that is fast and secure. SSH is currently the most reliable protocol for providing security for remote login sessions and other network services.
    • Enter the following command line in terminal or cmd:
ssh-keygen -t rsa -C "[email protected]"
    路径选择 : 使用该命令之后, 会出现提示选择ssh-key生成路径, 这里直接点回车默认即可, 生成的ssh-key在默认路径中;
    密码确认 : 这里我们不使用密码进行登录, 用密码太麻烦;就一路回车下去
  • Configure ssh into GitHub
windows应该是(C:\Documents and Settings\Administrator\.ssh (或者 C:\Users\自己电脑用户名\.ssh)中)。
---------------------------------------------------------------
然后用记事本打开id_rsa.pub,将里面的全部代码复制到github的SSH中。
---------------------------------------------------------------

id_rsa.pub 文件内容 :

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDS0qLtpontavr43AQntX4oBOsg2R3QlWubMYvfgJsIDX6NWd5RaIDLBLEMwIFLDcpvpQKvk5S/bTy4vTuWqeY6fkQ/tZBKksQn1WuYDcSfjLF8BuPMfdkboTh9NaKESKnsiWdranEVbmB5vOAHm8T+HFGdzG7Tz4ygzCnTwvdpBYrd/4jgeazws2d7CuMeuyb+FxdDTQy9YmJJm+82ypfR//bLyzRJo3SYadnPO3VdOAZCO1Isky+p/0nNN/obC4t2y2+oHBAqJV9h37f9S8UShgDmZoVLicRi4poni0i70xj+t/hnOsT8fmEc+vM9USyN+ndawz2oWjikKgln1jOB [email protected]
---------------------------------------------------------------
登陆github网站,点击Settings——SSH keys——点击右侧的Add SSH key ,接下去你懂得。
  • Verify that the configuration is successful
复制如下代码:

ssh -T [email protected]
然后出现如下信息:

Warning: Permanently added the RSA host key for IP address '192.30.252.131' to the list of known hosts.

Hi hawx1993! You've successfully authenticated, but GitHub does not provide shell access.
验证时可能让你输入YES,当出现以上信息时,说明配置成功,可以连接上GitHub;

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326190737&siteId=291194637