Skip to content

tsuty/git-user

Repository files navigation

git-user

Build Status

git client multi-user support command.

We use some git hosting services. But we use not always same user name and email.

Install

go get -u github.com/tsuty/git-user

Example

First, set your user info each hosting services.

git-user set -u git@github.com:* yourname yourname@example.com
git-user set -u git@gitlab.com:* othername othername@example.com
git-user set -u git@bitbucket.org:* somename somename@example.com

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

Useful

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)\$ '

bash complete

ln -s $GOPATH/src/github.com/tsuty/git-user/autocomplete/bash_autocomplete \
    /etc/bash_completion.d/git-user

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages