# Git-User-Switch : git 사용자 쉽게 변경하기

> Clean Markdown view of GeekNews topic #3203. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=3203](https://news.hada.io/topic?id=3203)
- GeekNews Markdown: [https://news.hada.io/topic/3203.md](https://news.hada.io/topic/3203.md)
- Type: news
- Author: [xguru](https://news.hada.io/@xguru)
- Published: 2020-11-15T10:36:41+09:00
- Updated: 2020-11-15T10:36:41+09:00
- Original source: [github.com](https://github.com/geongeorge/Git-User-Switch)
- Points: 8
- Comments: 3

## Topic Body

- 여러명의 사용자(개인/회사 등) 프로필간에 쉽게 변경하도록 하는 CLI 툴

ㅤ→ git-user 실행후 사용자 리스트에서 선택하면 바로 변경

- 글로벌/로컬 사용자 별도로 지원(로컬이 기본 값)

ㅤ→ ~/.gitconfig 또는 project/.git/config

- 사용자 추가/삭제 및 전체 리셋 지원

## Comments



### Comment 3520

- Author: galadbran
- Created: 2020-11-16T13:45:15+09:00
- Points: 1

여러 사람이 같은 계정으로 같은 폴더를 작업하는 경우 커밋 전에 사용자 확인하고 변경을 하게 하는 건 어떻게 할 수 있을까요? 조언 부탁드립니다

### Comment 3508

- Author: shockrabbit
- Created: 2020-11-16T08:50:42+09:00
- Points: 3

좋은 툴 공유해주셔서 감사합니다.

그외의 의견으로 path 에 따라서 gitconfig file 이 선택되도록 하는 것도 괜찮은 방법인 것 같습니다.

https://gist.github.com/bgauduch/06a8c4ec2fec8fef6354afe94358c89e

### Comment 3509

- Author: xguru
- Created: 2020-11-16T08:59:34+09:00
- Points: 1
- Parent comment: 3508
- Depth: 1

와!! 제가 보기엔 이거가 더 좋네요. 고맙습니다.

보통 회사 작업과 개인 작업은 폴더를 별도로 쓰기도 하니까, 한번 회사/개인 최상위 폴더만 작업해 두면 신경안쓰고 작업이 가능할 거 같아요.

.gitconfig 에서 IncludeIF 를 써서 폴더별로 다른 사용자 정보를 로딩하는 방식

  [includeIf "gitdir:~/code/personal/"]

  	path = .gitconfig-personal

  [includeIf "gitdir:~/code/professional/"]

  	path = .gitconfig-professional
