글로벌 Git 구성을 어떻게 표시합니까?
구성된 모든 Git 섹션을 표시하고 싶습니다.
을 찾았고 git config --get core.editor
구성된 기본 편집기뿐만 아니라 전역 적으로 구성된 모든 것을 출력하고 싶습니다.
을 사용 git config --list
하거나 ~/.gitconfig
파일을 볼 수 있습니다. 로컬 구성은 저장소 .git/config
파일에 있습니다.
git config --list --show-origin
해당 설정이 정의 된 위치를 확인하는 데 사용 합니다 (글로벌, 사용자, 리포지토리 등).
최단,
git config -l
시스템, 글로벌 및 로컬에서 상속 된 모든 값을 표시합니다.
git config --list
갈 방법 중 하나입니다. 나는 보통 그냥 열어 .gitconfig
.
글로벌 Git 구성을 어떻게 편집 합니까?
짧은 답변: git config --edit --global
Git 구성을 이해하려면 다음 사항을 알아야합니다.
Git 구성 변수는 세 가지 수준으로 저장할 수 있습니다. 각 수준은 이전 수준의 값을 재정의합니다.
1. 시스템 수준 (시스템의 모든 사용자 및 모든 저장소에 적용됨)
- 보기 위해
git config --list --system
(필요할 수 있음sudo
) - 설정,
git config --system color.ui true
- 시스템 구성 파일을 편집하려면
git config --edit --system
2. 글로벌 수준 (사용자에게 개인적으로 특정한 값).
- 보기 위해,
git config --list --global
- 설정,
git config --global user.name xyz
- 글로벌 구성 파일을 편집하려면
git config --edit --global
3. 저장소 수준 (해당 단일 저장소에만 해당)
- 보기 위해,
git config --list --local
- 설정하려면,
git config --local core.ignorecase true
(--local
선택 사항) - 저장소 구성 파일을 편집하려면
git config --edit --local
(--local
선택 사항)
모든 설정을 보려면 어떻게합니까 ?
- 실행
git config --list
, 표시 시스템 , 글로벌 , 및 (저장소 내부의 경우) 지역 CONFIGS - Run
git config --list --show-origin
, 각 구성 항목의 원본 파일도 표시합니다.
특정 구성을 어떻게 읽습니까?
- 예를 들어,
git config user.name
를 얻으려면 실행하십시오user.name
. - 당신은 또한 옵션을 지정할 수 있습니다
--system
,--global
,--local
특정 수준에서 그 값을 읽을 수 있습니다.
참조 : 1.6 시작하기-처음 Git 설정
를 호출 git config -e
하여 편집기에서 직접 구성 파일을 열 수도 있습니다. Git 구성 파일은 -l
출력 보다 훨씬 읽기 쉬우 므로 항상 -e
플래그 를 사용하는 경향이 있습니다 .
요약하자면 :
git config -l # List Git configuration settings (same as --list)
git config -e # Opens Git configuration in the default editor (same as --edit)
- 매개 변수가 없으면 로컬
.git/config
. - 으로
--global
그것은와 상호 작용~/.gitconfig
. - 그리고
--system
그것과 상호 작용합니다$(prefix)/etc/gitconfig
.
(정말 무슨 $(prefix)
뜻 인지 알 수 는 없지만 기본값은 $HOME
.)
를 사용할 수도 있습니다 cat ~/.gitconfig
.
Git 2.6 (2015 년 9 월 / 10 월)은 --name-only
a의 출력을 단순화하는 옵션 을 추가합니다 git config -l
.
참조 a92330d 커밋 , f225987 커밋 , 9f1429d 커밋 에 의해 (2015년 8월 20일) 제프 킹 ( peff
) .
참조 ebca2d4 커밋 (2015년 8월 20일을), 및 905f203 커밋 , 578625f 커밋 에 의해 (2015 8월 10일) SZEDER 가보를 ( szeder
) .
(Merged by Junio C gitster
Hamano -- in commit fc9dfda , 31 Aug 2015)
config
: add '--name-only
' option to list only variable names'
git config
' can only show values or name-value pairs, so if a shell script needs the names of set config variables it has to run 'git config --list
' or '--get-regexp
' and parse the output to separate config variable names from their values.
However, such a parsing can't cope with multi-line values.Though '
git config
' can produce null-terminated output for newline-safe parsing, that's of no use in such a case, because shells can't cope with null characters.Even our own bash completion script suffers from these issues.
Help the completion script, and shell scripts in general, by introducing the '
--name-only
' option to modify the output of '--list
' and '--get-regexp
' to list only the names of config variables, so they don't have to perform error-prone post processing to separate variable names from their values anymore.
One important thing about git config
:
git config
has --local
, --global
and --system
levels and corresponding files.
So you may use git config --local
, git config --global
and git config --system
.
By default, git config
will write to a local level if no configuration option is passed. Local configuration values are stored in a file that can be found in the repository's .git directory: .git/config
Global level configuration is user-specific, meaning it is applied to an operating system user. Global configuration values are stored in a file that is located in a user's home directory. ~/.gitconfig
on Unix systems and C:\Users\<username>\.gitconfig
on Windows.
System-level configuration is applied across an entire machine. This covers all users on an operating system and all repositories. The system level configuration file lives in a gitconfig
file off the system root path. $(prefix)/etc/gitconfig on Linux systems. On Windows this file can be found in C:\ProgramData\Git\config
.
So your option is to find that global .gitconfig
file and edit it.
Or you can use git config --global --list
.
This is exactly the line what you need.
If you just want to list one part of the Git configuration, such as alias, core, remote, etc., you could just pipe the result through grep. Something like:
git config --global -l | grep core
On Linux-based systems you can view/edit a configuration file by
vi/vim/nano .git/config
Make sure you are inside the Git init folder.
If you want to work with --global config
, it's
vi/vim/nano .gitconfig
on /home/userName
This should help with editing: https://help.github.com/categories/setup/
To find all configurations, you just write this command:
git config --list
In my local i run this command .
Md Masud@DESKTOP-3HTSDV8 MINGW64 ~
$ git config --list
core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
rebase.autosquash=true
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
http.sslbackend=openssl
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
credential.helper=manager
user.email=infomasud@gmail.com
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
filter.lfs.clean=git-lfs clean -- %f
참고URL : https://stackoverflow.com/questions/12254076/how-do-i-show-my-global-git-configuration
'developer tip' 카테고리의 다른 글
Trello는 사용자의 클립 보드에 어떻게 액세스하나요? (0) | 2020.09.28 |
---|---|
easy_install보다 pip를 사용하는 이유는 무엇입니까? (0) | 2020.09.28 |
어떤 버전의 PostgreSQL을 실행하고 있습니까? (0) | 2020.09.28 |
Mac OS X에서 PostgreSQL 서버를 시작하는 방법은 무엇입니까? (0) | 2020.09.28 |
파이썬에서 XML을 어떻게 구문 분석합니까? (0) | 2020.09.28 |