Git安装配置
在使用Git前我们需要先安装 Git。Git 目前支持 Linux/Unix、Solaris、Mac和 Windows 平台上运行。
Git 各平台安装包下载地址为:http://git-scm.com/downloads
![](https://images.cnblogs.com/cnblogs_com/bencoper/1625563/t_200102135003Git%E6%94%AF%E6%8C%81%E5%B9%B3%E5%8F%B0.png?a=1577973370400)
Windows平台上安装
在 Windows 平台上安装 Git ,有个叫做 msysGit 的项目提供了安装包,可以到 GitHub 的页面上下载 exe 安装文件并运行 下载地址
版本2.13.3
- 首先下载
git版本
,找到适合自己电脑的版本。 - 打开后是这个样子:
![](https://images.cnblogs.com/cnblogs_com/bencoper/1625563/o_200102135100Git%E5%AE%89%E8%A3%85-1.png)
![](https://images.cnblogs.com/cnblogs_com/bencoper/1625563/o_200102135450Git%E5%AE%89%E8%A3%851-1.png)
![](https://images.cnblogs.com/cnblogs_com/bencoper/1625563/o_200102135458Git%E5%AE%89%E8%A3%85-2.png)
![](https://images.cnblogs.com/cnblogs_com/bencoper/1625563/o_200102135505Git%E5%AE%89%E8%A3%85-3.png)
![](https://images.cnblogs.com/cnblogs_com/bencoper/1625563/o_200102135513Git%E5%AE%89%E8%A3%85-4.png)
![](https://images.cnblogs.com/cnblogs_com/bencoper/1625563/o_200102135520Git%E5%AE%89%E8%A3%85-5.png)
![](https://images.cnblogs.com/cnblogs_com/bencoper/1625563/o_200102141428Git%E5%AE%89%E8%A3%856-1.jpg)
基本配置
不管是 Windows 安装还是 Linux 安装,安装好之后,我们都先通过如下两行命令做一个基本配置,配置的信息将展示在我们每一次提交的后面,所以不要使用不方便公开的信息,如果不配置以后每次提交的时候都会让你输入用户名和密码,配置方式如下:
git config --global user.name "xxxx" 设置用户名
git config --global user.email "xxxx" 设置邮箱
git config user.name 查看用户名
git config user.email 查看邮箱
git config --global user.name "xxxx" 修改用户名
git config --global user.email "xxxx@xxx.com" 修改邮箱
这个配置会保存在当前用户目录下的.gitconfig文件中,如下:
![](https://images.cnblogs.com/cnblogs_com/bencoper/1625563/o_200102135526Git%E5%AE%89%E8%A3%85-6.png)
推荐两个Git学习网站---图文并茂---白嫖党
git-简明指南---助你入门 git 的简明指南,木有高深内容
Learn Git Branching---强烈安利---闯关教学---在线测试
OK! 原创不易,有问题欢迎留言讨论