[GIT] Git Config 계정 확인 및 변경

yedi·2024년 10월 13일
1
post-thumbnail

특정 Repository의 Git 계정 정보를 변경하기 위한 과정에서, 아래 내용을 정리했습니다.
전체 Repository와 특정 Repository의 Git 계정 정보를 확인하고 변경하는 방법을 알아보겠습니다.


전체 Repository 에서 Git 계정 확인 및 변경

1. 여러 Repository 중 어디든 이동

Repository $ 

2. 해당 Repository 에 .git 이 존재하지 않는다면, git 저장소 초기화

Repository $ git init 

3. 전체 Git 계정 설정 확인

Repository $ git config --global --list

4. 전체 Git 계정 설정 변경

Repository $ git config --global user.name "계정 이름"
Repository $ git config --global user.email "계정 이메일"

명령어 작성 후, git config --global --list 확인 시, 전체 Repository의 git 계정 정보가 변경된 것을 확인할 수 있습니다.



특정 Repository 에서 Git 계정 확인 및 변경

1. 내 Local 내에서 변경하고자 하는 Repository로 이동

Repository $ 

2. 해당 Repository 에 .git 이 존재하지 않는다면, git 저장소 초기화

Repository $ git init 

3. 특정 Git 계정 설정 확인

계정 정보가 해당 명령어로 확인되지 않는다면, --global로 설정되어 있을 가능성이 높습니다.

Repository $ git config --local --list

4. 특정 Git 계정 설정 변경

Repository $ git config --local user.name "계정 이름"
Repository $ git config --local user.email "계정 이메일"

명령어 작성 후, git config --local --list 확인 시, 특정 Repository의 git 계정 정보가 변경된 것을 확인할 수 있습니다.

0개의 댓글