zoukankan      html  css  js  c++  java
  • 连接到github

    1,创建秘钥

    $ ssh-keygen -t rsa -C "youremail@example.com"
    执行成功后,会在~/.ssh/目录下生成id_rsaid_rsa.pub这两个文件

    id_rsa.pub的作用是在github里输入用。
    生成秘钥的目的是,git push到github的时候,不再需要输入GitHub的用户名和密码


    2,登录github

    在SSH页输入 id_rsa.pub

    3,github上创建project

    4,关联本地库和github

    git remote add origin git@github.com:自己的github用户名/自己的git仓库.git

    5,推送本地的git到github

    git push -u origin master

    如果出现错误:Unable to find remote helper for 'https'
    参考:https://www.cnblogs.com/xiaoshiwang/p/9128282.html

    6,从github,clone项目到本地库

    git clone git@github.com:用户ID/库名.git

    7,把在github上的资源,下载到本地

    git pull origin master

    8, 远程库添加错了后,如何删除呢
    git remote
    能够列出远程库的名字
    git remote remove 远程库的名字


  • 相关阅读:
    UVA 254 Towers of Hanoi
    UVA 701 The Archeologists' Dilemma
    UVA 185 Roman Numerals
    UVA 10994 Simple Addition
    UVA 10570 Meeting with Aliens
    UVA 306 Cipher
    UVA 10160 Servicing Stations
    UVA 317 Hexagon
    UVA 10123 No Tipping
    UVA 696 How Many Knights
  • 原文地址:https://www.cnblogs.com/xiaoshiwang/p/9128327.html
Copyright © 2011-2022 走看看