创建github仓库
2018-02-25 本文已影响0人
非文666
还是准备去自己写一篇git的使用总结,让自己加深下印象。
- github是一个网站,是目前最大的版本控制社区网站,用户可以在上面申请账号,并创建自己的版本仓库。
- git是一个最原始的分布式版本控制系统,是开源的
1. 注册github账号,并创建开源仓库
github的官网地址是https://github.com/ ,注册成功之后显示页面如下:
![](https://img.haomeiwen.com/i10747384/112bbe07876bdcfd.png)
上图红色框点击可以新建开源仓库。
![](https://img.haomeiwen.com/i10747384/a0e11b3bbc684701.png)
这样线上版本库已经创建成功
![](https://img.haomeiwen.com/i10747384/199d08505af41d62.png)
2. 下载github desktop
因为github就是个版本管理工具,创建文件还是在本地,所以这里需要再下载一个github desktop用于提交本地的文件。
下载地址是 https://desktop.github.com/
![](https://img.haomeiwen.com/i10747384/cd86528aa3a56788.png)
如图,可做下面三种操作:
- create new repository 创建一个项目并发步到github上
- add a local repository 添加一个本地计算机已经存在的项目并发布到github上
- clone a repository 从github线上克隆一个项目到本地
create new repository
![](https://img.haomeiwen.com/i10747384/8ef93c333d92f8e9.png)
填写项目名称、描述、本地路径,点击新建。
![](https://img.haomeiwen.com/i10747384/26af70aaf16e6fd6.png)
add a local repository
本地存在一个普通目录,转换为git目录,并上传到GitHub上
![](https://img.haomeiwen.com/i10747384/c9efeec4572a147c.png)
![](https://img.haomeiwen.com/i10747384/9a4aec5b338a721d.png)
![](https://img.haomeiwen.com/i10747384/b86d831157645e40.png)
因为这是个普通文件,所以马上新建,点击new repository
![](https://img.haomeiwen.com/i10747384/ba08eb231d930fb9.png)
如果这个文件夹不为空也没有关系
![](https://img.haomeiwen.com/i10747384/238f78e924ad0b86.png)
点击publish,上传项目到github
clone repository
从线上拉取项目
![](https://img.haomeiwen.com/i10747384/ea02370d9fb923eb.png)
这里有三种方式
![](https://img.haomeiwen.com/i10747384/3feed80773a065f5.png)
- github.com是自己线上的项目
- URL可以其他人的项目地址
选择项目,点击clone 就将线上的项目拉取到本地路径