Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git-switch

git-switch

Switch your global git identity between saved profiles from a small desktop window.

git-switch stores name + email pairs and writes the one you pick to git config --global user.name / user.email. Rust + egui; one executable, no installer. Runs on Windows, macOS and Linux.

What it does

  • Shows the identity git currently has set, with the Gravatar for that email or a generated identicon when there is none
  • Add, edit and delete profiles; one click applies a profile
  • Deleting the active profile switches git to the next saved one
  • Rejects malformed emails (missing TLD, double dots, spaces) before they reach your commits
  • On quit, tells you which identity git will keep committing as

Only the global config is touched. A repo with its own user.name/user.email keeps it.

Install

Needs Rust and git on your PATH.

cargo install --git https://github.com/<you>/git-switch

Or build from a clone:

git clone https://github.com/<you>/git-switch
cd git-switch
cargo build --release

Output: target/release/git-switch (git-switch.exe on Windows).

Linux builds need the egui/winit system packages: X11 or Wayland dev headers, libxkbcommon, and OpenGL.

Usage

  1. Launch git-switch.
  2. Press +, enter a name and email, save.
  3. Click a profile to make it the global identity.

Profile storage

OS Path
Windows %APPDATA%\git-switch\git-switch\config\profiles.toml
macOS ~/Library/Application Support/dev.git-switch.git-switch/profiles.toml
Linux $XDG_CONFIG_HOME/git-switch/profiles.toml (default ~/.config/git-switch/)

Plain TOML. Edit it by hand or sync it between machines.

Development

cargo run    # debug build, console attached
cargo test   # email validation and git-output parsing

build.rs embeds icon.ico and app.manifest into the Windows executable. The manifest pins comctl32 v6; without it TaskDialogIndirect (used by the confirm dialogs) is missing and the exe fails to start with "entry point not found".

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages