git client multi-user support command.
We use some git hosting services. But we use not always same user name and email.
go get -u github.com/tsuty/git-user
First, set your user info each hosting services.
git-user set -u [email protected]:* yourname [email protected]
git-user set -u [email protected]:* othername [email protected]
git-user set -u [email protected]:* somename [email protected]
If you set user.name user.email to global conf, delete from global conf.
Sync git-user conf to local conf.
cd your_repository
git-user sync
show local conf
git config --local --get-regexp user*
# or
git-user local
If you use git-prompt (git completion) and setting prompt.
source ~/.git-prompt.sh
PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
Useful command git-user print
.
this command show local conf for prompt. and sync git-user conf to local conf automatically.
PS1='[\u@\h \W$(__git_ps1 " (%s)")]$(git-user print)\$ '
ln -s $GOPATH/src/github.com/tsuty/git-user/autocomplete/bash_autocomplete \
/etc/bash_completion.d/git-user