• Git与GitHub关联


    1.下载git,并注册github,本地装好git:在cmd运行git version 如果出现版本号,这就说明装好了并且创建一个新的仓库,我创建了一个新的仓库叫local并且勾选了Initialize this repository with a README(系统自动生成一个README文件)
    2.在本地创建一个文件夹(这个文件夹将会与github上的仓库(local)相连接),我这个文件夹命名为localgit.,在localgit文件夹中右键点击git Bash here
    3.第一条命令就是:(生成ssh密钥):$ git ssh-keygen -t rsa -C "your_email@youremail.com"/注意啊孩子,双引号里面是你的邮箱。然后一路回车,直到下一个$ 出现;意味着ssh密钥生成成功
    4.通常会出现一个/c/user/.ssh/.id_rsa。但是我们要的是同文件夹的id_rsa.pub,将id_rsa.pub中的字符全部复制将其粘贴在github上的Settings中
    ssh key的title可以随便取,我把它取名成local
    5. 在git中输入命令:$ git init  查看文件夹loaclgit发现一个隐藏文件.git

    6.在git中输入命令:$ git remote add origin https://github.com/xxxx/local.git (标注的是你关联仓库的网址)

     

    7.在git中输入命令:$ git pull origin master    可以将github仓库中的文件复制带本地localgit文件夹中
    8.在本地文件夹中创建一个index.html在git中输入命令:$ git add index.html(这只是将index.html放入了缓存区)再输入命令:$ git commit -m 'dome'(给index.html简介了一下)但是出现了以下情况

     

     那么在git中输入

    9.然后将缓存区的文件传入github仓库中输入命令:$ git push origin master

    其中会出现弹框,需要输入你登入github的username和password


  • 相关阅读:
    Learning Spark中文版--第三章--RDD编程(1)
    关于learning Spark中文版翻译
    dom4j 常用操作
    Invalid bound statement (not found)
    touch: cannot touch ‘/var/jenkins_home/copy_reference_file.log’: Permission denied
    docker 运行tomcat 并部署 java web项目
    docker build no such file or directory
    Docker 笔记
    java 自动拆箱 自动装箱
    Ubuntu18 中文乱码 问题 解决
  • 原文地址:https://www.cnblogs.com/lcbwwy/p/12632930.html
Copyright © 2020-2023  润新知