Skip to content

Latest commit

 

History

History
99 lines (64 loc) · 1.76 KB

README.md

File metadata and controls

99 lines (64 loc) · 1.76 KB

GIS - Git Identity Switcher

I made this CLI tool to learn more about Rust and make it easier for me to switch between git identities (Author and Email) on my machine. This is my first real project in Rust.

Installation

This is used on a Mac, probably won't work with other OS's.

cargo install --git https://github.com/Caelestis94/gis.git

Usage

By default the config is stored in ~/.gisrc. You can load your own config file with the --config flag.

Add a new identity

gis identity add "John Doe [email protected]"

List all identities

gis identity list

Output

1. Author : John Doe, Email : [email protected]
2. ...

Switch to an identity

The number is the index of the identity in the list.

gis switch 1

Remove an identity

The number is the index of the identity in the list.

gis identity remove 1

Add a workspace

This will add a workspace with the current identity attached to it.

gis workspace add "workspace name"

or for the current directory

gis workspace add .

List all workspaces

gis workspace list

Output

1. /path/to/workspace > Author : John Doe, Email : [email protected]
2. ...

Remove a workspace

The number is the index of the workspace in the list.

gis workspace remove 1

Check the current identity

gis current

Check if the current identity is the same as the workspace

This will check if the current identity is the same as the one attached to the workspace. And if not it will switch to the identity attached to the workspace. (This is how I use it in my .zshrc so I don't have to worry about switching identities when I switch workspaces).

gis check