Git CMD - config: Get and set repository or global options

命令参数

--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 "[email protected]"

b) 设置颜色高亮

$ git config --global color.ui true

c) 列出当前的配置选项

$ git config --list

更多

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

时间: 2024-08-06 11:57:04

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

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."解决方案 标签: git 2015-09-28 17:55 11492人阅读 评论(0) 收藏 举报  分类: git(2)  版权声明:本文为博主原创文章,未经博主允许不得转载. 我们在使用Git clone 或其他命令的时候,有时候会遇到这类问题,如图: fatal: Could not re

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

命令格式 git fetch [<options>] [<repository> [<refspec>…?]] git fetch [<options>] <group> git fetch --multiple [<options>] [(<repository> | <group>)…?] git fetch --all [<options>] 命令参数 --dry-run 不执行任何操作,只显

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

命令格式 git init [-q | --quiet] [--bare] [--template=<template_directory>] [--separate-git-dir <git dir>] [--shared[=<permissions>]] [directory] 命令参数 --quiet, -q 安静模式,只打印错误和警告信息. 实例 a) 创建版本库 [[email protected] git]$ mkdir hello_git [[email 

Git CMD - add: Record changes to the repository

命令格式 git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend] [--dry-run] [(-c | -C | --fixup | --squash) <commit>] [-F <file> | -m <msg>] [--reset-author] [--allow-empty] [--allow-empty-message] [--no-verify] [-e]

repo init &amp; git responsity config

1. Git Config:git config --global user.name "Shilin Yi"git config --global user.email "[email protected]"    配置git的参数变量,它可以带以下2个参数:   --system,针对系统的所有用户的,对应的配置文件在/etc/gitconfig   --global,针对系统当前用户的,对应的配置文件在~/.gitconfig   不带参数,针对当前git仓库

[Git]2018-10 解决git cmd中文乱码问题

2018年10月12日 莫名其妙出现cmd下git log中文乱码问题,显示一堆<E4><A8>之类的乱码.git bash却一切正常. 怀疑是Windows系统升级出现的不兼容问题. 把git升级到最新版本,没有解决问题. 参考网上设置 git config --global i18n.logoutputencoding gbk 无果,反而git bash也出现了乱码问题.大概判断是cmd的编码配置问题. 配置重设为:git config --global i18n.logout

git Could not read from remote repository 解决

错误: fatal: 'origin' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. 解决办法: [email protected] /f/gitrepo/TestJedis (master) $ git remote

OpenStack git cmd

1.创建分支 建立分支是你创建代码的独立版本的动作,独立于你的主干分支.默认地,每次你提交到Git的文件都会被储存到“master(主干)”分支.现在我们来说说,你想要向项目里添加一个功能,但你想要能够回滚到现在版本,以防出现差错,或者你决定要放弃这个功能.这就是你创建分支的时候了. 创建并同时切换到你新建的分支命令: git checkout -b new_feature 或者,你可以先创建一个分支然后手动切换: git branch new_feature  git checkout new

git cmd set

set http_proxy=http://proxy.yourname.com:8080set http_proxy_user=set http_proxy_pass= git config --global http.proxy http://10.167.196.133:8080git config –global http.proxy http://user:[email protected]://10.10.10.10:8080 git config --system (或 --glo