CGU (ChangeGitUser) is a command-line application written in Rust that allows you to manage multiple local git configuration files with ease. It provides various commands to Create, List, Delete, Import, and cycle through git configurations.
- Create and manage your local git configurations
- Quickly switch between different git configurations with just the
cgu
command - Import existing git configurations from files.
To use CGU, you need to have Rust installed on your system. If you don't have Rust installed, you can follow the official Rust installation guide here.
Once Rust is installed, you can proceed with the following steps to install CGU:
- Clone the repository or download the source code.
- Open a terminal and navigate to the project directory.
- Run the command
cargo build --release
to build the application. - The compiled binary will be available in the
target/release
directory. - You can either run the binary directly or add it to your system's PATH for convenient access.
CGU provides the following commands:
create
: Create a new git configuration.list
: List all present git configurations.delete <name>
: Delete a specific git configuration by name.import <filepath>
: Import a git configuration file.- Running the application without any command will cycle through the existing configurations and set the active configuration.
To Create a new git configuration, use the following command:
cgu create
You will be prompted to enter the required information such as name and email for the new configuration. Once entered, the configuration will be saved.
To List all the present git configurations, use the following command:
cgu list
This will display a List of all the configurations along with their names and emails.
To Delete a specific git configuration by name, use the following command:
cgu delete <name>
Replace <name>
with the name of the configuration you want to Delete. This will remove the specified configuration from the List.
To Import a git configuration file, use the following command:
cgu import <filepath>
Replace <filepath>
with the path to the configuration file you want to Import. This will add the configuration from the file to the List of configurations.
Running the CGU application without any command will cycle through the existing configurations and set the active configuration. This allows you to quickly switch between different git configurations.
CGU stores the git configurations in a JSON file located at ~/.config/cgu/config.json
. Each configuration is represented as a JSON object within an array in the file.
- Release on the AUR
- Renaming configurations
- Exporting configurations
- GPG Key-Selection support
- Support for Windows and macOS
- Change cycle order
- integrating fzf as alternative to cycling
- Colorful outputs
Contributions to CGU are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.
CGU is released under the MIT License.