Skip to content
/ git-ps Public

Git Profile Switcher (git-ps) A command-line tool for managing multiple Git configurations. Switch between different Git user profiles easily for work, personal projects, or different organizations.

Notifications You must be signed in to change notification settings

0xdx2/git-ps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Git Profile Switcher (git-ps)

A command-line tool for managing multiple Git configurations. Switch between different Git user profiles easily for work, personal projects, or different organizations.

Features

  • 🔄 Switch between multiple Git profiles quickly
  • 📝 Interactive profile creation and management
  • 📋 List all available profiles
  • 🎯 Show current active profile
  • 🗑️ Remove profiles when no longer needed
  • 💾 Persistent configuration storage

Installation

From Source

git clone <repository-url>
cd git-ps
cargo build --release

The binary will be available at target/release/git-ps.

Add to PATH (Optional)

To use git-ps from anywhere, add the binary to your PATH or copy it to a directory already in your PATH:

cp target/release/git-ps /usr/local/bin/

Usage

List all profiles

git-ps list

Show current active profile

git-ps current

Switch to a profile

# Interactive selection
git-ps use

# Direct switch (if profile exists)
git-ps use work-profile

Add a new profile

git-ps add

This will interactively prompt you for:

  • Profile name
  • Git user name
  • Git email address

Remove a profile

# Interactive selection
git-ps remove

# Direct removal (if profile exists)
git-ps remove old-profile

Configuration

Profiles are stored in your system's configuration directory:

  • macOS: ~/Library/Application Support/git-ps/
  • Linux: ~/.config/git-ps/
  • Windows: %APPDATA%\git-ps\

The configuration file is named profiles.yaml and contains all your saved Git profiles.

Example Workflow

  1. Add your work profile:

    git-ps add
    # Enter: work, John Doe, [email protected]
  2. Add your personal profile:

    git-ps add
    # Enter: personal, John Doe, [email protected]
  3. Switch between profiles:

    git-ps use work      # Switch to work profile
    git-ps use personal  # Switch to personal profile
  4. Check current profile:

    git-ps current

Requirements

  • Rust 1.70+ (for building from source)
  • Git (the tool manages Git configurations)

Dependencies

  • clap - Command-line argument parsing
  • serde & serde_yaml - Configuration serialization
  • anyhow - Error handling
  • dirs - Cross-platform directory paths
  • inquire - Interactive prompts

License

MIT License

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

Git Profile Switcher (git-ps) A command-line tool for managing multiple Git configurations. Switch between different Git user profiles easily for work, personal projects, or different organizations.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages