2013.10.30——— git学习之安装
参考:[url]http://www.xbc.me/install-git-on-windows/[/url]
1、下载
[url]http://msysgit.github.io/[/url]
下载最新版本的 git版本
2、安装Msysgit
[img]http://dl2.iteye.com/upload/attachment/0090/6778/de07aa8a-86ed-38a5-98f6-b131c7c32d87.jpg[/img]
[img]http://dl2.iteye.com/upload/attachment/0090/6780/c720ead5-7847-3636-a05c-d18c078dc31a.jpg[/img]
[img]http://dl2.iteye.com/upload/attachment/0090/6782/d837eb91-82b7-362c-9143-7f20ee11327e.jpg[/img]
[img]http://dl2.iteye.com/upload/attachment/0090/6784/73e1b0af-ac88-3095-9a10-49f644011034.jpg[/img]
[img]http://dl2.iteye.com/upload/attachment/0090/6786/d132be80-6742-33bd-bbd2-53545f00b698.jpg[/img]
[img]http://dl2.iteye.com/upload/attachment/0090/6788/0d82d89c-852d-3c75-be46-73f9c822dc87.jpg[/img]
[img]http://dl2.iteye.com/upload/attachment/0090/6790/a45c250e-6f6a-3e38-bb7e-3804f17f7528.jpg[/img]
[img]http://dl2.iteye.com/upload/attachment/0090/6792/9ea78706-f462-3917-8ad8-44eea084ea6a.jpg[/img]
[img]http://dl2.iteye.com/upload/attachment/0090/6794/fba716ba-8c08-332e-abc0-eaa74776ce16.jpg[/img]
3、设置全局变量
Git 提供了一个叫做git config 的工具(译注:实际是git-config 命令,只不过可以通过git 加一个
名字来呼叫此命令。),专门用来配置或读取相应的工作环境变量。而正是由这些环境变量,决定了Git 在
各个环节的具体工作方式和行为。这些变量可以存放在以下三个不同的地方:
• /etc/gitconfig文件:系统中对所有用户都普遍适用的配置。若使用git config 时用--system 选项,读写
的就是这个文件。
• ~/.gitconfig文件:用户目录下的配置文件只适用于该用户。若使用git config 时用--global 选项,读写
的就是这个文件。
• 当前项目的git 目录中的配置文件(也就是工作目录中的.git/config 文件):这里的配置仅仅针对当前
项目有效。每一个级别的配置都会覆盖上层的相同配置,所以.git/config 里的配置会覆盖/etc/gitconfig
中的同名变量。
3.1、用户信息
3.2、查看所有的配置信息
3.3、vi修改配置信息
3.4、获取帮助
参考:[url]http://www.xbc.me/install-git-on-windows/[/url]
1、下载
[url]http://msysgit.github.io/[/url]
下载最新版本的 git版本
2、安装Msysgit
[img]http://dl2.iteye.com/upload/attachment/0090/6778/de07aa8a-86ed-38a5-98f6-b131c7c32d87.jpg[/img]
[img]http://dl2.iteye.com/upload/attachment/0090/6780/c720ead5-7847-3636-a05c-d18c078dc31a.jpg[/img]
[img]http://dl2.iteye.com/upload/attachment/0090/6782/d837eb91-82b7-362c-9143-7f20ee11327e.jpg[/img]
[img]http://dl2.iteye.com/upload/attachment/0090/6784/73e1b0af-ac88-3095-9a10-49f644011034.jpg[/img]
[img]http://dl2.iteye.com/upload/attachment/0090/6786/d132be80-6742-33bd-bbd2-53545f00b698.jpg[/img]
[img]http://dl2.iteye.com/upload/attachment/0090/6788/0d82d89c-852d-3c75-be46-73f9c822dc87.jpg[/img]
[img]http://dl2.iteye.com/upload/attachment/0090/6790/a45c250e-6f6a-3e38-bb7e-3804f17f7528.jpg[/img]
[img]http://dl2.iteye.com/upload/attachment/0090/6792/9ea78706-f462-3917-8ad8-44eea084ea6a.jpg[/img]
[img]http://dl2.iteye.com/upload/attachment/0090/6794/fba716ba-8c08-332e-abc0-eaa74776ce16.jpg[/img]
3、设置全局变量
Git 提供了一个叫做git config 的工具(译注:实际是git-config 命令,只不过可以通过git 加一个
名字来呼叫此命令。),专门用来配置或读取相应的工作环境变量。而正是由这些环境变量,决定了Git 在
各个环节的具体工作方式和行为。这些变量可以存放在以下三个不同的地方:
• /etc/gitconfig文件:系统中对所有用户都普遍适用的配置。若使用git config 时用--system 选项,读写
的就是这个文件。
• ~/.gitconfig文件:用户目录下的配置文件只适用于该用户。若使用git config 时用--global 选项,读写
的就是这个文件。
• 当前项目的git 目录中的配置文件(也就是工作目录中的.git/config 文件):这里的配置仅仅针对当前
项目有效。每一个级别的配置都会覆盖上层的相同配置,所以.git/config 里的配置会覆盖/etc/gitconfig
中的同名变量。
3.1、用户信息
$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com
3.2、查看所有的配置信息
$ git config --list
3.3、vi修改配置信息
$ git config -e --global
3.4、获取帮助
$ git help <verb>
例如
$ git help config
就会打开config相关帮助的文档