Git(2.14.1版本)学习及使用(一)

OuZeBo原创作品。转载请注明出处 http://www.cnblogs.com/OuZeBo/p/7477465.html

1、下载git:https://git-scm.com/

2、安装(本人选择默认路径,下一步-->end)

3、注册github账号

4、git的简单配置

  $ git config --global user.name yourName

  $ git config --global user.email yourEmail@xxx.com

 

5、github配置添加SSH

  $ ssh-keygen -t rsa -C "yourEmail@xxx.com"

ssh-key的生成路径(默认路径):C:/user/administrator/.ssh下的id_rsa.pub文件下

  

  

6、将ssh配置到GitHub中

id_rsa.pub用记事本打开,将里面内容复制到github ssh配置中的key

7、创建本地仓库

可参考:http://www.runoob.com/git/git-create-repository.html

$ git clone <github项目仓库路径> <本地项目路径>

 

 8、上传文件到github仓库

   手动创建d.txt 

  $ git add d.txt 

  $ git commit   //将文件上传到本地仓库

  $ git push    //将文件上传到guihub项目仓库

 

注:在$ git commit过程中,可能出现这个错误(E325:注意Aborting commit due to empty commit message.):

这个错误是在git 提交时没有写注示文字

操作:新建一个命令窗口,输入: $ git commit -m "注释文字"

9、下载github项目仓库文件

  $ git pull

 

 

 

 

原文地址:https://www.cnblogs.com/OuZeBo/p/7477465.html