day6-Windows下关于git的安装与配置
2018-07-21 本文已影响121人
RurouniKenshin
git的安装
首先是git的安装包下载
点此下载 - 2.18.0-64版本
点击下载后的安装包

进入安装界面
在第一次点击next后选中这个选项(方便我们在桌面找到应用文件)

之后一路默认配置

桌面会产生一个Git Bash的图标就是我们的git入口了
点击Git Bash进入

$ git config --global user.name "Your Name"
$ git config --global user.email "email@example.com"
因为Git是分布式版本控制系统,所以,每个机器都必须自报家门:你的名字和Email地址。
建议输入自己的确定的信息
然后需要进行版本库的创建
因为是windows系统,最好保证目录(包括父目录)不含有中文
首先进入你想要创建版本库的文件目录下

我这是演示就在e盘下创建
然后

$ mkdir mygit (输入这条命令完敲击 enter键)
$ cd mygit (输入这条命令完敲击 enter键)
$ pwd (输入这条命令完敲击 enter键,显示如下)
/e/mygit
接下来将这个文件夹变成我们的仓库(一开始没有东西或者有东西都行)

$ git init(在该文件夹目录下输入这条命令完敲击 enter键,显示如下)
Initialized empty Git repository in E:/mygit/.git/
瞬间Git就把仓库建好了,而且告诉你是一个空的仓库(empty Git repository)
注意:这时会在该文件夹下自动生成一个.git ,不要随意修改