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.
This is used on a Mac, probably won't work with other OS's.
cargo install --git https://github.com/Caelestis94/gis.git
By default the config is stored in ~/.gisrc
. You can load your own config file with the --config
flag.
gis identity add "John Doe [email protected]"
gis identity list
1. Author : John Doe, Email : [email protected]
2. ...
The number is the index of the identity in the list.
gis switch 1
The number is the index of the identity in the list.
gis identity remove 1
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 .
gis workspace list
1. /path/to/workspace > Author : John Doe, Email : [email protected]
2. ...
The number is the index of the workspace in the list.
gis workspace remove 1
gis current
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