我的git别名在哪里存储? [英] Where is my git alias stored?

查看:110
本文介绍了我的git别名在哪里存储?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个我找不到的别名。输入 git help subaddvim 给我:

 `git subaddvim'是别名到`log HEAD'

我想我是这样定义的:

  git config --local alias.subaddvim'log HEAD'

我查看了 $ repo_path / .gitconfig 〜/ .gitconfig / etc / gitconfig ,但没有一个具有subaddvim条目。



我还能看到什么?

解决方案

使用无证件(或已过时) - 本地国旗和没有标志。 Git永远不会在您的存储库根目录( $ repo_path / .gitconfig )中查找gitconfig。 Repo本地配置更改位于 .git / config



git help config 解释了有效的选项:

<全局>
写入选项:写入全局〜/ .gitconfig文件而不是
repository .git / config。

 阅读选项:只读全局〜/ .gitconfig而不是
所有可用文件。

- system
写入选项:写入系统范围的$(前缀)/ etc / gitconfig而不是
,而不是存储库.git / config。

 对于阅读选项:只读从系统范围$(前缀)/ etc / gitconfig 
而不是来自所有可用文件。

(使用git版本1.7.9)

<你可以尝试用这个命令(从你的回购根目录,假设git安装在/ bin中):

pre $ grep subaddvim。 git / config〜/ .gitconfig / etc / gitconfig


I have an alias that I cannot find. Typing git help subaddvim gives me:

`git subaddvim' is aliased to `log HEAD'

I think I defined it like this:

git config --local alias.subaddvim 'log HEAD'

I looked in $repo_path/.gitconfig, ~/.gitconfig, /etc/gitconfig, but none of them have a subaddvim entry.

Where else can I look?

解决方案

There is no difference between using the undocumented (or is it obsolete) --local flag and no flag. Git never looks for a gitconfig in your repository root ($repo_path/.gitconfig). Repo-local config changes are in .git/config.

git help config explains the valid options:

--global For writing options: write to global ~/.gitconfig file rather than the repository .git/config.

   For reading options: read only from global ~/.gitconfig rather than from
   all available files.

--system For writing options: write to system-wide $(prefix)/etc/gitconfig rather than the repository .git/config.

   For reading options: read only from system-wide $(prefix)/etc/gitconfig
   rather than from all available files.

(Using git version 1.7.9)

You could try searching with this (from your repo root and assuming git is installed in /bin):

grep subaddvim .git/config ~/.gitconfig /etc/gitconfig

这篇关于我的git别名在哪里存储?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆