git github

/*
时间:2018/11/19
目录: 
  一: 访问github
  二: 访问github - 失败解决
     1 dns检测
     2 修改host文件
     3 应用
  三: 安装git
     1 安装步骤
     2 验证安装
  四: 创建仓库 1 github - 服务器 2 git - 本地   五: 更新仓库   六: 下载仓库
  七: 参考资料
*/

一: 访问github

1 : 打开谷歌浏览器,输入: https://github.com/

2 : 注册一个github账号,并登录。

1 : 注册成功后,可以在搜索栏中输入: selenium

1 : 页面显示搜索结果。

2 : 左侧栏可以进一步细分搜索结果,右侧安装星的等级显示(最受欢迎的)。

二: 访问github - 失败解决
  1 dns检测

1 : 使用站长工具,访问 http://tool.chinaz.com/dns。

1 : 在搜索栏中输入: https://github.com/  点击搜索。

2 : 选择较小TTL的IP地址。


  2 修改host文件

1 : 进入磁盘目录: C:WindowsSystem32driversetc。

1 : 填写较小TTL的ip和网址。


  3 应用

1 : cmd中输入: ipconfig /displaydns( 查看DNS缓存内容) 。

1 : 可以看到刚刚填写的网址和ip地址 。

1 : cmd中输入: ipconfig /flushdns( 更新DNS) 。

三: 安装git

  1 安装步骤

1 : 打开谷歌浏览器,输入: https://git-scm.com/download/

2 : 选择合适的系统和版本进行下载。

1 : 下载完成后,双击安装包。

2 : 点击"Next"。

1 : 选择安装目录,点击"Next"。

1 : 勾选如图勾选的框,点击"Next"。

2 : 后面安装步骤都是点击"Next"。

  2 验证安装

1 : 新建一个文件夹,在目录上输入cmd。

1 : 输入: git

1 : 出现如图信息,说明安装成功。


四: 创建仓库
  1 github - 服务器

1 : 如果点击 “New repository”(建立一个新的代码库)。

1 : 在name栏中输入 代码库名字。

2 : 在description栏中输入 代码库的描述信息。

3 : 点击"Create repository"

1 : 出现如图信息,代表服务端代码库创建成功。


  2 git - 本地

1 : 在cmd中输入: git init (建仓)

1 : 出现如图代表建仓成功。

1 : 在建仓文件夹中添加一下文件和代码。

2 : 在cmd中输入: git add * (文件添加到本地仓库)

1 : 在cmd中输入: git status (查看仓库状态)

1 : 在cmd中输入: git commit -m "first commit" (提交到本地缓存,“”里是说明)

2 : 输入用户姓名和电子邮箱(github网站的)

1 : 在cmd中输入: git commit -m "first commit" (提交到本地缓存,“”里是说明)

1 : 在cmd中输入: git remote add origin https://github.com/falygogo/hello (提交到github上,后面url是github建立仓库的url)

1 : 在cmd中输入: git push -u origin master (上传到master分支上)。

1 : 使用谷歌浏览器,输入github新建代码仓库地址。

2 : 可以看到本地文件已经上传 github上面。


五: 更新仓库

1 : 在cmd中输入: git add * (文件添加到本地仓库)。

2 : 在cmd中输入: git commit -m "first commit" (提交到本地缓存,“”里是说明)

3 : 在cmd中输入: git pull (服务端更新本地)。

4 : 在cmd中输入: git push -u origin master (本地上传到master分支上)。


六: 下载仓库

1 : 在cmd中输入: git clone https://github.com/falygogo/hello (github代码库下载本地)。


七: 参考资料

http://www.runoob.com/git
https://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000
原文地址:https://www.cnblogs.com/huafan/p/9980853.html