Gitup 🚀
Manage your Git identity across multiple accounts and projects.
gitup is cross-platform CLI tool designed to check, install, and manage your Git configurations with ease. The profile management, allows to switch between work, personal, and other Git accounts with a single command.
Table of Contents
Key Features
- Git Installation Check: Verifies if Git is installed on your system.
- Cross-Platform Guidance: If Git is not installed,
gitupprovides the correct installation command for your OS. - Interactive Setup: A guided
gitup setupcommand for new users that configures name, email, and signing key, then offers to save it all as a profile. - Cryptographic Signing: Associate GPG/SSH signing keys with your profiles to ensure all commits for that identity are automatically and correctly signed.
- Effortless Profile Management: Save multiple Git configurations and switch between them seamlessly.
- Interactive Switching: Simply run
gitup useto get an interactive list of profiles to choose from. - Shell Completions: Generate completion scripts for Bash, Zsh, Fish, and other shells for a faster workflow.
- Script-Friendly: A global
--jsonflag provides machine-readable output for all commands. - Secure by Design: Does not require or execute commands with
sudoitself; it empowers the user to run provided installation commands securely.
Installation
You will need the Rust toolchain (version 1.70 or newer) installed.
-
Install from Crates.io (Recommended):
-
Build from Source:
# Clone the repository # Build the release binary # The executable will be at `target/release/gitup` # For global access, move it to a directory in your PATH
Usage
Initial Setup
For first-time use, the setup command is the best starting point. It will guide you through setting your name, email, and an optional GPG/SSH signing key. It will then ask if you want to save the result as your first profile.
Checking Configuration
To see your current global user.name, user.email, user.signingkey, and the active gitup profile.
Alias: gitup status
Profile Management
This is the core feature for managing multiple Git identities.
Switch Profiles (Easy Switch)
Run use without a name for an interactive selector. This is the easiest way to switch contexts.
Or switch directly if you know the name: gitup use personal
Save a New Profile
This command reads your current global Git configuration (including signing key) and saves it as a named profile.
# First, ensure your global config is what you want to save
# Then, save it
List All Saved Profiles
Alias: gitup ls
You will see a list of your profiles, with the active one highlighted.
Saved Profiles
- personal
- work (active)
Show the Active Profile
Alias: gitup active
Delete a Profile
Alias: gitup rm
Shell Completions
To enable shell completions, you need to generate the script for your shell and source it in your shell's configuration file (e.g., .bashrc, .zshrc).
Bash
Add the following to your ~/.bashrc:
Zsh
Add the following to your ~/.zshrc:
Fish
Add the following to your ~/.config/fish/config.fish:
|
Non-Interactive Configuration
For use in scripts or CI/CD environments.
# Set config using long flags
# Or with short flags
# Unset a signing key by passing an empty string
# Flags can also be populated from environment variables
Configuration
gitup stores its profile data in a simple JSON file located at:
- Linux/macOS:
$HOME/.config/gitup/config.json - Windows:
{FOLDERID_RoamingAppData}\gitup\config.json
It is recommended to manage this file through the CLI commands.
Contributing
Contributions, issues, and feature requests are welcome. Please check the issues page for this project.
License
This project is licensed under the MIT License.
Author
Lucian BLETAN