Skip to main content

Account manager for git users with multiple accounts.

Project description

gitu

Account manager for git users with multiple accounts.

Install

Install gitu from PyPi:

pip install gitu

Usage

usage: gitu [-h] {login,l,add,a,view,v,edit,e,remove,r} ...

positional arguments:
  {login,l,add,a,view,v,edit,e,remove,r}
    login (l)           switch users
    add (a)             add a new user
    view (v)            view information of users
    edit (e)            edit the information of a user
    remove (r)          remove a user

optional arguments:
  -h, --help            show this help message and exit

Add a user

Usage

usage: gitu add [-h] [-r] [-a ALIAS] [-g] name email

positional arguments:
  name                  name of the user
  email                 email of the user

optional arguments:
  -h, --help            show this help message and exit
  -r, --replace         replace the user if the name or alias already exists
  -a ALIAS, --alias ALIAS
                        add a alias to the user
  -g, --gpgsign         set commit.gpgsign to true

Example

# Add a new user Misaka
gitu add Misaka misaka@example.com
# Add a new user Shirai with alias Kuroko
gitu a -a Kuroko Shirai shirai@example.com

Switch users

Usage

usage: gitu login [-h] [--local] [-g] [-s] [-w] name

positional arguments:
  name            name or alias of the user

optional arguments:
  -h, --help      show this help message and exit
  --local         write to or read from the repository .git/config file
                  (default)
  -g, --global    write to or read from global ~/.gitconfig file
  -s, --system    write to or read from system-wide $(prefix)/etc/gitconfig
  -w, --worktree  write to or read from .git/config.worktree if
                  extensions.worktreeConfig is present

Example

# Login as Misaka
gitu login Misaka
# Login as Shirai Kuroko globally
gitu l -g Kuroko

View users

Usage

usage: gitu view [-h] [--local] [-g] [-s] [-w] [-l] [-a]

optional arguments:
  -h, --help      show this help message and exit
  --local         write to or read from the repository .git/config file
                  (default)
  -g, --global    write to or read from global ~/.gitconfig file
  -s, --system    write to or read from system-wide $(prefix)/etc/gitconfig
  -w, --worktree  write to or read from .git/config.worktree if
                  extensions.worktreeConfig is present
  -l, --list      list all users
  -a, --all       show all information of users

Example

# View local user
gitu view
# View global user
gitu v -g
# List all users
gitu v -l
# List all users in details
gitu v -la

Edit a user

Usage

usage: gitu edit [-h] [-n NEW_NAME] [-e EMAIL] [-a ALIAS]
                     [--remove-alias ALIAS] [-g] [-r]
                     name

positional arguments:
  name                  name or alias of the user

optional arguments:
  -h, --help            show this help message and exit
  -n NEW_NAME, --name NEW_NAME
                        new name of the user
  -e EMAIL, --email EMAIL
                        new email of the user
  -a ALIAS, --alias ALIAS
                        add a new alias to the user
  --remove-alias ALIAS  remove the alias of the user
  -g, --gpgsign         set commit.gpgsign to true
  -r, --replace         replace the user if the name or alias already exists

Example

# Rename Misaka to Mikoto
gitu edit Misaka -n Mikoto
# Change Email
gitu e Shirai -e shirai@gakuen-toshi.tech
# Add alias
gitu e -a Onee-sama Mikoto
# Remove alias
gitu e --remove-alias Onee-sama Mikoto

Remove a user

Usage

usage: gitu remove [-h] name

positional arguments:
  name        name or alias of the user

optional arguments:
  -h, --help  show this help message and exit

Example

# Remove a user
gitu remove Kamijou

Exit status

The status is one of the follows:

  • 0 (SUCCESS): the operation succeeded.
  • 1 (USER_NOT_FOUND): the user does not exist.
  • 2 (USER_EXISTS): the user already exists. To replace the user, use -r/--replace.
  • 3 (GIT_ERROR): failed to execute a git command.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gitu-0.1.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gitu-0.1.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file gitu-0.1.0.tar.gz.

File metadata

  • Download URL: gitu-0.1.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.1

File hashes

Hashes for gitu-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d7ec320928819444138bc024623fb28805514adf9685a41b1c007da88ac9e423
MD5 fe6ac46fc78d55db59d9ca04cf8f1a26
BLAKE2b-256 3c4a376730b3fb76985f531ad9f5f753ca166a1b39244101d8fd62c823f501e7

See more details on using hashes here.

File details

Details for the file gitu-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: gitu-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.1

File hashes

Hashes for gitu-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 943bfc9ea5adf3146bfb4c1f0e7401a2a6d22537414389f1e2777033eb06c7d2
MD5 50010b02911dc16eb8bd94ff8d4bf7c1
BLAKE2b-256 b48214ece51f8012ee2a3496481d0a09ab3156ff5623a1d4f6d8c084882de330

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page