[GIT] 사용자 정보 변경/삭제/설정하기

문지은·2023년 3월 21일

Git

목록 보기
4/6
post-thumbnail

Git에서 변경사항을 저장(commit)하기 위해서는 사용자의 정보(이름, 이메일주소)가 필요한데,
Git은 config 파일로부터 사용자의 정보를 읽어 변경사항을 저장한다.

따라서 이미 등록된 작성자 정보를 변경하기 위해서는 config에 설정된 작성자 정보를 삭제한다음에 다시 등록하면 된다.

작성자 정보 삭제하기

  • 지역 설정일 경우
$ git config --unset user.name
$ git config --unset user.email
  • 전역 설정일 경우
$ git config --unset --global user.name
$ git config --unset --global user.email
  • 중복된 value값이 있을 경우에는 --global 뒤에 -all을 붙이면 된다.
$ git config --unset-all user.name
$ git config --unset-all user.email

$ git config --unset-all --global user.name
$ git config --unset-all --global user.email

작성자 정보 설정하기

  • 지역 설정일 경우
$ git config user.name "이름"
$ git config user.email "이메일주소"
  • 전역 설정일 경우
$ git config --global user.name "이름"
$ git config --global user.email "이메일주소"

작성자 정보 확인하기

$ git config --list
또는
$ git config --global -l
profile
코드로 꿈을 펼치는 개발자의 이야기, 노력과 열정이 가득한 곳 🌈

0개의 댓글