命令参数

--get

获取指定的配置项。

--global

对于写选项:全局配置,将参数配置于 ~/.gitconfig 而不是仓库目录下的 .git/config。对于读选项:只从 ~/.gitconfig 文件中读取配置。

--local

  对于写选项:将参数配置于 仓库目录下的 .git/config,这是默认的设置。

-l, --list

  列出配置文件中的所有配置项。

配置文件

如果没有显示地指定 --file 选项,则有 4 个文件供 git 配置查询配置项。

$(prefix)/etc/gitconfig

全系统的配置文件

~/.gitconfig

用户特定的配置文件,也称为全局配置文件。

$XDG_CONFIG_HOME/git/config

用户特定的次要的配置文件。如果 $XDG_CONFIG_HOME 没有设置或者为空,$HOME/.config/git/config 会被替代。

$GIT_DIR/config

仓库特定的配置文件。

实例

a) 设置用户名与用户邮件 ID

$ git config --global user.name "huey"
$ git config --global user.email "huey@example.com"

b) 设置颜色高亮

$ git config --global color.ui true

c) 列出当前的配置选项

$ git config --list

更多

http://git-scm.com/docs/git-config

Git CMD - config: Get and set repository or global options的更多相关文章

  1. git配置config文件

    1.Git有一个工具被称为git config,它允许你获取和设置变量:这些变量可以控制Git的外观和操作的各个方面.这些变量以等级的不同可以被存储在三个不同的位置: (1) /etc/gitconf ...

  2. git "Could not read from remote repository.Please make&n

    git "Could not read from remote repository.Please make sure you have the correct access rights. ...

  3. Git GUI,Git Bash,Git CMD之间的区别

    Git GUI,Git Bash,Git CMD之间的区别 Git Bash: Bash,Unix shell的一种,Linux与Mac OS X v10.4都将它作为默认shell.Git Bash ...

  4. Git CMD - init: Create an empty Git repository or reinitialize an existing one

    命令格式 git init [-q | --quiet] [--bare] [--template=<template_directory>] [--separate-git-dir &l ...

  5. Git CMD - clone: Clone a repository into a new directory

    命令格式 git clone [--template=<template_directory>]  [-l] [-s] [--no-hardlinks] [-q] [-n] [--bare ...

  6. Git CMD - fetch: Download objects and refs from another repository

    命令格式 git fetch [<options>] [<repository> [<refspec>…​]] git fetch [<options> ...

  7. Git CMD - pull: Fetch from and integrate with another repository or a local branch

    命令格式 git pull [options] [<repository> [<refspec>…​]] 命令参数 -q, --quiet 安静模式. -v, --verbos ...

  8. Git CMD连接,管理(remote,add,commit,push)github repository

    git initmd testcd testgit statusgit add test  //git add test/a.txtgit status git remote add origin g ...

  9. Git CMD - add: Record changes to the repository

    命令格式 git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend] [--dry-run] [(-c ...

随机推荐

  1. UVa 1640 The Counting Problem (数学,区间计数)

    题意:给定两个数m, n,求从 m 到 n 中0-9数字各出现了多少次. 析:看起来挺简单的,其实并不好做,因为有容易想乱了.主要思路应该是这样的,分区间计数,先从个位进行计,一步一步的计算过来.都从 ...

  2. android 脸部抠图

    原帖:http://www.eoeandroid.com/thread-205445-1-1.html package com.face; import android.app.Activity; i ...

  3. OGNL stack value 值栈(主要参考官方手册)

    The framework uses a standard naming context to evaluate OGNL expressions. The top level object deal ...

  4. 更改Android AVD路径

    添加环境变量 变量名:ANDROID_SDK_HOME 变量值:D:\Program Files\Java //SDK路径

  5. OpenNebula Restfull 接口请求示例

    Fri Jun 20 07:28:20 2014 [I]: 10.0.2.2 - - [20/Jun/2014 07:28:20] "POST /vmtemplate HTTP/1.1&qu ...

  6. C#中反射的使用(How to use reflect in CSharp)(3)Emit的使用

    Emit意在动态构建一个可以执行(当然也就可以反射)或者只可以反射的动态库. 个人认为在不得不使用反射的情况下,使用Emit会使得效率提升空间很大.亦或者动态插件模式的软件设计中会用到. 依然2%的废 ...

  7. 节点文件将两个不同格式的XML文件,进行节点对照,并生成一个用于对照功能的XML

    本文纯属个人见解,是对前面学习的总结,如有描述不正确的地方还请高手指正~ 经常有的需求是,需要将一种格式的XML转换成另一种XML.如果要实现这个功能首先需要将两个不同XML手动建立节点对比关系.然后 ...

  8. URAL 1779 F - The Great Team 构造

    F - The Great TeamTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest ...

  9. URAL 2046 A - The First Day at School 模拟题

    A - The First Day at SchoolTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudg ...

  10. delphi label1 文字在窗体上水平来回移动

    //文字在窗体上水平来回移动 procedure TForm1.Timer1Timer(Sender: TObject);{ Timer1.Interval:=10;}begin  if label1 ...