Skip to content

Command line interface to switch easily between git user accounts

License

Notifications You must be signed in to change notification settings

lucasnevespereira/go-gituser

Repository files navigation

logo

GitHub release GitHub release

Overview

User of multiple git accounts, in order to meet my need to switch regularly between these accounts (student, professional, personal), I developed an open source cli (a command line interface) in Golang.

This program helps switch between different git user accounts easily.

It automates the following commands:

git config --global user.name "yourUsername"
git config --global user.email "yourEmail"

Modes

There is currently 3 modes in this script:

  • 💻 work : for a work related git account.
  • 📚 school : for a school related git account.
  • 🏠 personal : for a personal related git account.

How to install

Install with Homebrew

brew tap lucasnevespereira/tools
brew install gituser

or

brew install lucasnevespereira/tools/gituser

Install manually

Make sur your bin path is in your $PATH, you can check in your .zshrc or .bash file.

e.g

export PATH="$HOME/bin:$PATH"

Run the following command from the root of the project:

make install

This will build gituser and move it to your $HOME/bin

Now you can call gituser globally 😀

Add your git account data

Run the following command :

gituser setup

This command will help you setup your different git accounts.

Usage

Call executable with mode

gituser <mode>

Examples:

gituser work
gituser school
gituser personal

Flags

The flag help is a default flag that prints existing flags.

The flag manual will print some information about the program.

The flag info that will print some information about the accounts.

The flag now that will print what git account is currently active.

gituser <flag>

How to Contribute

If you want to contribute to this project please read the Contribution Guide.


License

This project is under MIT LICENSE