Git

저장소별 계정 설정

느리지만 꾸준하게 2021. 8. 9. 16:35

command line에서 git 사용 시 이름과 계정을 설정 해준다. 그러면 git commit, git push 할 때마다 계정 정보를 입력하지 않아도 된다.

git config --global user.name "K-J-HYEON"
git config --global user.email "kjh950601@naver.com"

만약에 저장소마다 다른 계정으로 로그인 해야할 경우 local을 이용한다. global보다 우선순위가 높다.

git config --local user.name "~~"
git config --local user.email "~~"

설정 후에 local로 지정된 사용자 계정 정보로 commit/push가 이루어진다.

설정 확인은 아래와 같이 한다.

git config --list

 

 

참고: https://awesometic.tistory.com/128

 

깃(git) - 프로젝트/저장소마다 다른 계정 정보 사용하기

저장소별 계정 설정 Command line 에서 git을 사용하려면, git 설치 후 간단한 설정 두 가지 정도는 해줘야 편해요. 계정과 이름 설정을 해주면 git commit , git push 할 때마다 계정 정보를 입력하지 않아

awesometic.tistory.com

 

'Git' 카테고리의 다른 글

Git Alias 설정  (0) 2022.01.03
does not have a commit checked out 에러 해결(git error)  (0) 2021.11.23
git push error  (0) 2021.11.05
git push error  (0) 2021.11.02
Git과 Github는 무엇인가?(Dream coding)  (0) 2021.07.01