Skip to content

rohansen856/gitshift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitShift 🔀

Rust License: MIT

A secure CLI tool for managing multiple GitHub accounts with SSH keys. Switch between work and personal accounts seamlessly! 🔐

[GitShift Demo]

Features ✨

  • 🧩 Multi-Account Management - Store unlimited GitHub accounts
  • 🔒 Secure Storage - Automatically handles SSH key permissions
  • 🚀 Context-Aware Operations - Clone/push with active account credentials
  • 📋 Interactive Setup - Guided account creation process
  • 🌐 Cross-Platform - Works on Linux, macOS, and Windows

Installation 📦

From Source

cargo install --git https://github.com/rohansen856/gitshift.git

From crates.io (Recommended)

# Nightly required or edition2024 support
cargo +nightly install gitshift 

Quick Start 🚀

  1. Add New Account
gitshift add --name work --algorithm ed25519
  1. List Accounts
gitshift ls
  1. Activate Account
gitshift activate work
  1. Clone Repository
gitshift clone [email protected]:company/project.git

Configuration ⚙️

File Structure

~/.config/gitshift/
├── config.json    # Account configurations
├── state.json     # Active account state
└── ssh_keys/      # SSH key storage (700 permissions)

Example config

[
    {
        "name": "work",
        "email": "[email protected]",
        "ssh_key_path": "~/.config/gitshift/ssh_keys/work_id",
        "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1..."
    }
]

Command Reference 📚

Command | Description | Example add | Create new account | gitshift add ls | List accounts | gitshift ls activate | Switch account | gitshift activate personal clone | Clone repository | gitshift clone [email protected]:user/repo.git info | Show account details | gitshift info work

Development 🛠️

Build Instructions

git clone https://github.com/rohansen856/gitshift.git
cd gitshift
cargo build --release

Troubleshooting 🐞

Q: Getting "Permission denied" when cloning A:

  1. Verify active account: gitshift ls

  2. Check GitHub SSH setup: ssh -T [email protected]

  3. Confirm key permissions: ls -la ~/.config/gitshift/ssh_keys

Q: Error saving configuration A: Ensure proper directory permissions:

chmod 700 ~/.config/gitshift

About

Manage multiple github/gitlab/bitbucket accounts from one system!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages