Categorygithub.com/tsuty/git-user
repositorypackage
1.0.1
Repository: https://github.com/tsuty/git-user.git
Documentation: pkg.go.dev

# README

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 [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

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