gitHub 基本操作

作者: zlf_j | 来源:发表于2018-05-16 17:03 被阅读28次

一、 关联本地库和远程库:

1. C盘 windows 打开Git Bash
  • git config --global user.name '你自己的用户名'
  • git config --global user.email '你自己的邮箱'
2. 创建SSH Key
  • ssh-keygen -t rsa -C "你的邮箱地址" 文件名
  • 确认密码...
  • 复制 C盘 -> user -> Administrator -> .ssh文件夹 -> id_rsa_pub 中的内容
    (id_rsa_pub文件路径不固定)
  • 注意:

mac找不到.ssh文件夹时,在git中执行 open ~/.ssh 回车,即可看到.ssh文件夹

3. 添加秘钥
  • 登录GitHub, 点个人图标
  • 打开“Account settings”,
  • "SSH Keys”页面:然后,点“Add SSH Key”, 填入任意Title,在Key文本框里粘贴id_rsa.pub文件的内容
4. 执行:
  • 新建文件夹(含html文件) 打开Git Bash
    git init 出现 .git文件 // 取消 rm -rf .git
    git status 红色 工作区
    git add .
    git status 绿色 暂存区
  • GitHub 新建文件
    git commit -m 'add new file' 提交到版本库
    git status 没东西
    复制GitHub中的
    git remote add origin 自己项目地址
    git push -u origin master
    执行

二、 克隆别人的项目:

  • 新建文件夹 打开 Git Bash
  • git clone 对方的地址

参考:https://www.cnblogs.com/jf-67/p/6415637.html

三、 github本地修改后如何上传

  • git pull // 拉取代码
    git status // 查看文件状态
    git add .(提交所有文件) / 文件路径
    git commit -m '提交注释'
    git push
  • 注意:

第一次创建repository后,修改文件想要提交,发现commit changes为灰色。
初步分析是24小时后才能提交

具体过程可参考:
https://note.youdao.com/share/?id=178db978be603399f7b40fdcc21edebf&type=note#/
github用法参考:
https://guides.github.com/activities/hello-world/

相关文章

  • github基本操作

    一、新建github账号并配置SSH_Key 1.1 访问github网站https://github.com,注...

  • gitHub 基本操作

    一、 关联本地库和远程库: 1. C盘 windows 打开Git Bash git config --glo...

  • github基本操作

    详见官方文档https://guides.github.com/activities/hello-world/

  • github基本操作

    灵魂三连问: github干啥的?答:github就是个版本仓库,你要多人协同做个项目,你在github建个仓库,...

  • GitHub基本操作

    Quick setup — if you’ve done this kind of thing before Ge...

  • GitHub

    GitHub基本操作

  • GitHub最基本操作

    下载安装就不详细说明,就写一下比较常用的操作。 1.在Web端上创建一个新的文件夹repositories,一般默...

  • github的基本操作

    初始化仓库 增加/删除文件 查看信息 分支管理

  • GitHub的基本操作

    一、GitHub的基本操作 1.1.使用in限制搜索 1.2.根据stars和forks数筛选 1.3.使用awe...

  • GitHub基本操作指南(一)

    一、新建仓库,设置本地与远程仓库间的账号与地址,并复制远程仓库 新建仓库,并获取ssh地址; 打开终端,进入本地仓...

网友评论

    本文标题:gitHub 基本操作

    本文链接:https://www.haomeiwen.com/subject/gofmdftx.html