git의 각종 설정

도토리·2023년 4월 7일
0

git & github

목록 보기
10/10

global, local 설정

git의 설정

  • global 설정: config를 '--global'과 함께 지정한다.
git config --global user.name (이름)
git config --global user.email (이메일)
git config --global init.defaultBranch main
  • local 설정: '--global' 없이 config를 지정한다.
git config user.name (이름)
git config user.email (이메일)

특정 프로젝트에서만 이름, 이메일을 다르게 하고 싶을 때


설정 확인하기

1. 현재 프로젝트에 적용된 설정 확인하기 (global, local 설정이 모두 나타남)

git config --list

EX) 내 프로젝트에 대해 다음과 같이 설정하였고,

git config user.name hello
git config user.email hello@naver.com

'git config --list'를 입력하였다.

remote.origin.url=https://github.com/gitgetgot3017/git-practice2.git
user.name=hello
user.email=hello@naver.com

등등 정말 다양한 설정값을 볼 수 있다.

1-2. 현재 프로젝트에 적용된 global 설정만 확인하기

git config global --list

2. 이 설정값을 CLI가 아닌 vscode에서 확인하기
vscode에서 설정값을 볼 수 있고, 설정값을 변경할 수 있다.

git config --global core.editor "code --wait"
git config --global -e (또는 git config -e)


code: vscode를 CLI에서 나타낸 것
--wait: CLI

0개의 댓글