用法:git config [选项]

配置文件位置
    --global              使用全局配置文件
    --system              使用系统级配置文件
    --local               使用版本库级配置文件
    -f, --file <文件>     使用指定的配置文件
    --blob <数据对象ID>   从给定的数据对象读取配置

操作
    --get                 获取值:name [value-regex]
    --get-all             获得所有的值:key [value-regex]
    --get-regexp          根据正则表达式获得值:name-regex [value-regex]
    --get-urlmatch        获得 URL 取值:section[.var] URL
    --replace-all         替换所有匹配的变量:name value [value_regex]
    --add                 添加一个新的变量:name value
    --unset               删除一个变量:name [value-regex]
    --unset-all           删除所有匹配项:name [value-regex]
    --rename-section      重命名小节:old-name new-name
    --remove-section      删除一个小节:name
    -l, --list            列出所有
    -e, --edit            打开一个编辑器
    --get-color <slot>    找到配置的颜色:[默认]
    --get-colorbool <slot>
                          找到颜色设置:[stdout-is-tty]

类型
    --bool                值是 "true" 或 "false"
    --int                 值是十进制数
    --bool-or-int         值是 --bool or --int
    --path                值是一个路径(文件或目录名)

其它
    -z, --null            终止值是NUL字节
    --includes            查询时参照 include 指令递归查找


1.查看config

  git config --list

  可以列出所有config配置

 user.email=tang_m_cong@.com
user.name=thomas
core.editor=vim
alias.co=checkout
alias.br=branch
alias.ci=commit
alias.st=status
alias.last=log - HEAD
alias.d=difftool
color.diff=auto
color.status=auto
color.branch=auto
diff.tool=bc3
difftool.bc3.path=/usr/bin/bcompare
merge.tool=bc3
mergetool.bc3.path=usr/bin/bcompare
difftool.prompt=false
mergetool.prompt=false
core.repositoryformatversion=
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=https://git.oschina.net/thammer/hisimain.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master

2.常用config:

  git config --global diff.tool bc3

  git config  --global difftool.bc3.path "/usr/bin/bcompare"

  git config --global difftool.prompt false

  git config --global alias.dt difftool

3.杂七杂八

  git log --name-status:查看提交时修改了哪些文件

  • git add -A All
  • git add . stages new and modified, without deleted
  • git add -u without new

后续补充

git一些常用设置的更多相关文章

  1. GIT 版本控制常用命令学习汇总

    GIT 版本控制常用命令汇总 git version 查看当前git版本信息 git help 获取全部命令帮助信息 git help <command> 获取指定命令帮助信息 git c ...

  2. 记录一下git 的常用命令

    以后如果要写一个东西,最好先搭建一个本地仓库,用版本控制对其进行操作,可能一开始有一些麻烦,但是很有可能会受益无穷. 说到git,必然会和github联系起来. 不管是在ubuntu里面还是在Wind ...

  3. linux云服务器常用设置

    前面的话 由于在云服务器上配置自己的网站,将Linux里的常用设置记录如下 更改shell 默认地, ubuntu系统默认的shell是dash,但更常用的shell是bash 通过下面命令可以将da ...

  4. git操作常用命令

    一.使用git 1.git是什么? Git是目前世界上最先进的分布式版本控制系统. SVN与Git的最主要的区别? SVN是集中式版本控制系统,版本库是集中放在中央服务器的,而干活的时候,用的都是自己 ...

  5. Eclipse常用设置及快捷键

    1. Eclipse常用设置 1.1 代码自动提示 选择菜单:Window -> Preferences -> Java -> Editor -> Content Assist ...

  6. Visual Studio Code常用设置及快捷键

    1. Visual Studio Code常用设置 { // 控制是否显示 minimap(缩略图) "editor.minimap.enabled": false, // 控制折 ...

  7. Git 基础 —— 常用命令

    Git 基础学习系列 Git 基础 -- 安装 配置 别名 对象 Git 基础 -- 常用命令 Git 基础 -- 常见使用场景 Git基础 -- Github 的使用 git init 创建 Git ...

  8. git的常用命令。。

    git的常用命令.. git help <command>  显示command的help git show  显示某次提交的内容 git show $id git co -- <f ...

  9. git介绍-常用操作(一)

    Table of Contents 1  系列文章 2  git说明 3  git常用命令 3.1  基本操作 3.2  远程操作 4  查看git的配置 4.1  查看已配置项 4.2  其他配置 ...

随机推荐

  1. .net接口学习笔记

    1.接口的声明 接口的声明不能包含:数据成员,静态变量:只能包含如下类型的静态成员函数的声明:方法,属性,事件,索引器.声明中不能包含任何实现的代码,而在每个成员成名的主体后,必须使用分号. 接口声明 ...

  2. 收集了50道基础的java面试题

    下面的内容是对网上原有的Java面试题集及答案进行了全面修订之后给出的负责任的题目和答案,原来的题目中有很多重复题目和无价值的题目,还有不少的参考答案也是错误的,修改后的Java面试题集参照了JDK最 ...

  3. 设置窗体透明C#代码

    上个示例是C#调用windows api 在原来代码上加入窗体透明,控件不透明代码: using System; using System.Runtime.InteropServices; using ...

  4. jQuery: jquery.json.js

    http://api.jquery.com/jQuery.parseJSON/ http://www.json.org/json-zh.html http://fineui.codeplex.com/ ...

  5. java基础练习[一]

    moka同学java学习笔记 package moka.hello; public class HelloWorld {     public static void main(String[] ar ...

  6. MVC Html.AntiForgeryToken() 防止CSRF攻击

    转自:http://blog.csdn.net/cpytiger/article/details/8781457 一.MVC中的Html.AntiForgeryToken()是用来防止跨站请求伪造(C ...

  7. RHEL7管道与重定向

    文件描述符 可以理解为linux跟踪打开文件,而分配的一个数字,这个数字有点类似c语言操作文件时候的句柄,通过句柄就可以实现文件的读写操作 用户可以自定义文件描述符范围是:3-num,这个最大数字,跟 ...

  8. Virtual DOM 算法

    前端 virtual-dom react.js javascript 目录: 1 前言 2 对前端应用状态管理思考 3 Virtual DOM 算法 4 算法实现 4.1 步骤一:用JS对象模拟DOM ...

  9. thinkPHP学习笔记(1)

    现在对前端的要求越来越高了  基本上身为一个前端人员需要会一种后台语言,于是选择了当下流行的php.因为是自学对我这个不怎么懂代码的人来说还是有点难度的. 1.先看看thinkphp的目录结构 ├─T ...

  10. How to Build Office Developer Tools Projects with TFS Team Build 2012

    Introduction Microsoft Visual Studio 2012 provides a new set of tools for developing apps for Office ...