命令参数

--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. iPhone 3GS/4 / 4s/5

    越努力.越幸福.----willingseal. 像素与分辨率有什么区别与联系 ????点击打开链接 像素和分辨率是成正比的,像素越大,分辨率也越高 像素 简单的说,我们通常所说的像素,就是CCD/C ...

  2. 从Jetty、Tomcat和Mina中提炼NIO构架网络服务器的经典模式(二)

    本文转载自 http://blog.csdn.net/cutesource/article/details/6192145 下面再来看看Tomcat是如何使用NIO来构架Connector这块的. 先 ...

  3. linux的shell脚本入门

    Linux shell脚本入门教程 为什么要进行shell编程 在Linux系统中,虽然有各种各样的图形化接口工具,但是sell仍然是一个非常灵活 的工具.Shell不仅仅是命令的收集,而且是一门非常 ...

  4. [转]ORA-00907: 缺失右括号

    转至:http://www.cnblogs.com/Olive116/p/5149680.html ORA-00907: 缺失右括号 前言 最近在开发过程中使用oracle数据库,在程序中进行查询数据 ...

  5. jQuery弹性滑动导航菜单实现思路及代码

    <!DOCTYPE HTML> <html> <head> <meta charset="UTF-8" /> <meta na ...

  6. 高扩展的基于NIO的服务器架构

    当你考虑写一个扩展性良好的基于Java的服务器时,相信你会毫不犹豫地使用Java的NIO包.为了确保你的服务器能够健壮.稳定地运行,你可能会花大量的时间阅读博客和教程来了解线程同步的NIO selec ...

  7. vc 获取当前时间 (zhuan)

    vc 获取当前时间(2010-02-10 11:34:32) http://wenku.baidu.com/view/6ade96d049649b6648d7475e.html 1.使用CTime类 ...

  8. IEBrowse学习笔记

    //登录 private void toolStripButton1_Click(object sender, EventArgs e) { //ie.ExecuteScript("aler ...

  9. java 分页

    ListAction.java package com.sy.action; import java.util.List; import com.opensymphony.xwork2.ActionS ...

  10. 多线程访问winform控件出现异常的解决方法

    一.  多线程访问winform控件出现异常的解决方法 1.  问题描述<1> 如果创建某控件的线程之外的其他线程试图调用该控件,则会引发一个 InvalidOperationExcept ...