2016-05-04 10 views
1

Windowsのbashでは、git config --listは複数のスコープの設定を表示しますが、それぞれのスコープを教えてくれません。は、 `git config --list`の各項目のスコープを表示します。

core.autocrlfをすべてfalseに設定することで、CRLFの問題が再発しないようにしようとしています。第二1は私のlolcatzプロジェクトにおそらくローカルであるように思え

$ git config --list 
core.symlinks=false 
core.autocrlf=input   // <-- HERE 
core.fscache=true 
color.diff=auto 
color.status=auto 
color.branch=auto 
color.interactive=true 
help.format=html 
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt 
diff.astextplain.textconv=astextplain 
rebase.autosquash=true 
credential.helper=manager 
gui.recentrepo=C:/Users/Buttle/PhpstormProjects/stuffs 
gui.recentrepo=C:/Users/Buttle/PhpstormProjects/lolcatz 
user.name=buttletime 
[email protected] 
core.autocrlf=false    // <-- AND HERE 
credential.helper=cache --timeout=3600 
core.repositoryformatversion=0 
core.filemode=false 
core.bare=false 
core.logallrefupdates=true 
core.symlinks=false 
core.ignorecase=true 
core.hidedotfiles=dotGitOnly 
remote.origin.url=https://github.com/buttletime/lolcatz.git 
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/* 
gui.wmstate=normal 
gui.geometry=1385x655+182+182 420 192 
branch.master.remote=origin 
branch.master.merge=refs/heads/master 

git config --listは私にこのような何かを提供します。しかし私のグローバル設定は、私がそれをチェックすると "偽"です。

答えて

2

git config --list --show-originは、設定のソースファイルを提供します。

If not set explicitly with --file, there are four files where git config will search for configuration options:

$(prefix)/etc/gitconfig : System-wide configuration file.

$XDG_CONFIG_HOME/git/config : Second user-specific configuration file. If $XDG_CONFIG_HOME is not set or empty, $HOME/.config/git/config will be used. Any single-valued variable set in this file will be overwritten by whatever is in ~/.gitconfig . It is a good idea not to create this file if you sometimes use older versions of Git, as support for this file was added fairly recently.

~/.gitconfig : User-specific configuration file. Also called "global" configuration file.

$GIT_DIR/config : Repository specific configuration file.

編集:man git-configのFILESセクションから

--show-originフラグがv2.8

+0

に導入されたようにこれは比較的新しい機能で見えるそれは – Whymarrh

+0

に導入されたとき、あなたは注意する必要があります。これはよさそうですどのファイルを見るかを少なくとも教えてください。しかし、 'git config'を使って値を変更するには、もっと情報が必要です。 'git config --system'を試してみたり、システムを" global "や" local "に置き換えると、どこにでも' core.autocrlf = input'が表示されないので混乱します。ファイル 'C:\\ ProgramData/Git/config'にあります。それはどのような範囲ですか? –

+0

マニュアルページには* nixスタイルのファイルシステム用のファイルがありますが、 'C:\ ProgramData/Git/config'はシステム全体の設定ファイルだと思います。 – 10101

関連する問題