'config'에 해당되는 글 1건

  1. 2016.12.21 [Git] 기본설정

[Git] 기본설정

Git 2016. 12. 21. 14:59

Git 사용시 기본 설정방법에 대해 알아본다.


Git 설정확인

  • $ git config --list


기본사용자설정

  • $ git config --global user.name "ChangHyun Lee"
  • $ git config --global user.email leechwin1@gmail.com


Commit Template 설정

  • $ git config --global commit.template {Template 파일 경로}
  • $ git config --global commit.template /home/leechwin/git/commit.template


Commit Template 해제

  • config --global --unset commit.template


색상 설정

  • $ git config --global color.ui true


CRLF 설정(커밋시 CRLF를 LF로 변환)

  • Linux
    • $ git config --global core.autocrlf input
  • Windows
    • $ git config --global core.autocrlf true

SSH Config 설정
  • ~/.ssh/config 파일 설정 예제
    • Host tizen
    • User leechwin
    • Port 29418
    • Hostname review.tizen.org
    • IdentityFile ~/.ssh/id_rsa
  • Proxy 환경일 경우 Proxy 설정 추가
    • ProxyCommand nc -x111.111.111.111:18080 -Xconnect review.tizen.org 29418

Change ID 자동설정 예제
  • $ cd gitDir
  • $ scp -p -P 29418 leechwin@review.tizen.org:hooks/commit-msg .git/hooks/
  • SSH Config 설정이 되어있다면
    • $ scp -p -P 29418 tizen:hooks/commit-msg .git/hooks/


설정된 속성은 다음 파일에 저장된다.

  • /etc/gitconfig : 시스템 전역 ( git config --system )
  • ~/.gitconfig : 특정 사용자 ( git config --global )
  • .git/config : 특정 Git


Posted by leechwin
,