Git_[18] 각종 설정

Leejaegun·2025년 1월 30일

Git

목록 보기
21/32

Git 설정 정리

1. Git 설정 범위

  • 전역(global) 설정: --global 옵션 사용
  • 로컬(프로젝트별) 설정: --global 옵션 생략

2. 현재 설정값 확인

  • 모든 설정값 보기:
    git config --list
  • Vim 에디터에서 설정 수정:
    git config -e
  • VS Code에서 설정 수정:
    git config --global core.editor "code --wait"
    • code: VS Code 실행
    • --wait: 창을 닫을 때까지 Git이 대기

3. 줄바꿈 문제 해결 (운영체제별)

  • Windows:
    git config --global core.autocrlf true
  • Mac/Linux:
    git config --global core.autocrlf input

4. Git Pull 기본 전략

  • Merge 방식(기본값):
    git config pull.rebase false
  • Rebase 방식 사용:
    git config pull.rebase true

5. Git 단축키(alias) 설정 (추천하지 않음)

  • 예제 (commit -am을 cam으로 단축):
    git config --global alias.cam "commit -am"
  • 하지만 단축키 설정은 오히려 헷갈릴 수 있으므로 신중히 사용해야 함.
profile
Lee_AA

0개의 댓글