Git:Config
Get and set repository or global options.
SYNOPSIS
git config [<file-option>] [type] [-z|--null] name [value [value_regex]]
git config [<file-option>] [type] --add name value
git config [<file-option>] [type] --replace-all name value [value_regex]
git config [<file-option>] [type] [-z|--null] --get name [value_regex]
git config [<file-option>] [type] [-z|--null] --get-all name [value_regex]
git config [<file-option>] [type] [-z|--null] --get-regexp name_regex [value_regex]
git config [<file-option>] --unset name [value_regex]
git config [<file-option>] --unset-all name [value_regex]
git config [<file-option>] --rename-section old_name new_name
git config [<file-option>] --remove-section name
git config [<file-option>] [-z|--null] -l | --list
git config [<file-option>] --get-color name [default]
git config [<file-option>] --get-colorbool name [stdout-is-tty]
git config [<file-option>] -e | --edit
Default gitconfig
최초 Git(Windows 기준)설치시 포함되어있는 etc/gitconfig
의 내용은 아래와 같다.
[core]
symlinks = false
autocrlf = false
[color]
diff = auto
status = auto
branch = auto
interactive = true
[pack]
packSizeLimit = 2g
[help]
format = html
[http]
sslCAinfo = /bin/curl-ca-bundle.crt
[sendemail]
smtpserver = /bin/msmtp.exe
[diff "astextplain"]
textconv = astextplain
[rebase]
autosquash = true
Config file location
설정파일 위치는 아래와 같은 목록이 존재한다.
-
--global
- use global config file
-
--system
- use system config file
-
--local
- use repository config file
-
-f, --file <file>
- use given config file
Setting check
아래와 같이 입력하면 입력된 설정정보를 확인할 수 있다.
Save password
인증 정보를 저장하고 싶다면 해당 저장소 안에서 아래와 같이 입력하면 된다.
Setting up name and e-mail address
Git 사용자이름과 E-Mail 주소를 설정하는 방법은 아래와 같다.
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
임시로 사용자 정보를 적용하는 방법
임시로 사용자명 이메일 주소 변경.
Installation Options line endings
Also, for users of Unix/Mac:
For Windows users:
Console UI Color setting
콘솔에 출력되는 문자에 색상을 주는 방법은 아래와 같다.
Alias setting
긴 명령어를 하나의 별명(Alias)으로 적용하는 방법은 아래와 같다.
push.default
push.default
속성은 Push했을 경우 기본 작동방법에 대한 옵션이다. 사용방법은 아래와 같다.
- matching: 모든 로컬의 브랜치명을 원격과 비교해서 같은 곳을 모두 push 하게 된다.
- simple: 현재 작업중이 브랜치만 push 하게 된다.
SSL certificate rejected
SSL 인증서 문제로 인해 아래와 같은 메시지가 출력될 수 있다.
이 경우 아래와 같이 SSL 인증서 검증을 SKIP하는 방법이 있다.
Http Post buffer size
- Git, fatal: The remote end hung up unexpectedly
- Git fails when pushing commit to github
- Gitlab error "fatal: The remote end hung up unexpectedly"
아래와 같은 에러가 발생할 경우가 있다.
소스 파일 사이즈보다 postBuffer의 크기가 작을 경우 문제가 된다. Http POST 요청 버퍼 사이즈를 설정 한다.
i18n setting
UTF-8 설정 (Window 환경 해당)
Proxy setting
http_proxy
, https_proxy
, all_proxy
와 같은 환경변수를 사용하거나,
별도 지정할 경우 http.proxy
설정을 추가:
추가적으로 대부분의 사이트는 HTTPS를 사용하며 보통 프록시를 통과할 경우 인증서검증에 실패할 가능성이 있습니다.
인증서 검증 우회를 위한 http.sslVerify=false
설정 추가:
보통 내부 Git Repository는 프록시네트워크 안쪽에 위치하므로 Proxy 예외처리를 진행하게 됩니다.
Git에서는 http.
<url>.*
을 사용하여 특정 URL에 설정을 지정할 수 있게 되어있습니다.
예시로 https://code.oofbird.me
를 Git Repository라고 할 경우 다음과 같이 Proxy를 공백으로 설정하시면 됩니다.
.gitconfig 파일에 직접 저장할 경우:
Remove credentials
Retype:
Include another gitconfig file
Git (1.7.10+) now supports this syntax in .gitconfig
: