美文网首页
Pro Git 学习笔记 (一, 基础)

Pro Git 学习笔记 (一, 基础)

作者: 冯斯特罗 | 来源:发表于2017-03-06 15:07 被阅读5次

初次运行 Git 前的配置

Git的配置通过 git config来完成,有三个等级:

| 参数 | 文件路径 | 说明 |
|-|-|
| --system | /etc/gitconfig | 全局的 |
| --global | ~/.gitconfig 或 ~/.config/git/config |针对当前用户的全局属性|
| 不带参数 | .git/config | 默认当前仓库配置 |

$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com
$ git config --global core.editor vim

git config --list 命令来列出所有 Git 当时能找到的配置。

$ git config --list
user.name=John Doe
user.email=johndoe@example.com
color.status=auto
color.branch=auto
color.interactive=auto
color.diff=auto

$ git config user.name
John Doe

若你使用 Git 时需要获取帮助,有三种方法可以找到 Git 命令的使用手册:

$ git help <verb>
$ git <verb> --help
$ man git-<verb>

$ git help config

相关文章

网友评论

      本文标题:Pro Git 学习笔记 (一, 基础)

      本文链接:https://www.haomeiwen.com/subject/pchugttx.html