Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

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, john.doe@company.com
  2. Add your personal profile:

    git-ps add
    # Enter: personal, John Doe, john@personal.email
  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

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages