A cli tool to manage multiple git config profiles and switch between different git configurations with ease & grace.
npm install gitconfig-mangitconfig-man
=============


!Test Coverage
!Tests Passing


!Node Version







A sophisticated CLI tool to manage multiple git config profiles and switch between different git configurations with ease & grace.
| Workflow | Status |
|----------|--------|
| Build & Test |  |
| Test Coverage | !Coverage |
| NPM Publish | !Publish |
Tests run automatically on:
- ✅ Ubuntu (Linux) - Node.js 16.x, 18.x, 20.x
- ✅ macOS - Node.js 16.x, 18.x, 20.x
- ✅ Windows - Node.js 16.x, 18.x, 20.x
19 Tests | 19%+ Coverage | All Tests Passing
Managing different git configurations for different projects or accounts can be tedious. This package makes your life easier by creating different git config profiles and managing them for you. Perfect for developers who need to switch between personal and work accounts, or manage multiple git identities.
`` sh`
npm install -g gitconfig-man
`
➜ ~ gitconfig-man -h
Git Config Man - Git Config Profile Manager
Usage: gitconfig-man
Commands:
-i Initialize gitconfig-man and create default profile
-c [name] Create new git config profile (interactive if no name)
-s [name] Switch to another git config profile (interactive if no name)
-d [name] Delete git config profile (interactive if no name)
-ls List all profiles
-h Show help
-v Show version
Tip: Run commands without arguments for interactive mode
`
gitconfig-man supports interactive mode with autocomplete! Simply run commands without arguments to get an enhanced interactive experience:
- gitconfig-man -s - Interactive profile switcher with autocomplete
- gitconfig-man -c - Interactive profile creator with validation
- gitconfig-man -d - Interactive profile deletion with confirmation
Calling gitconfig-man -i creates a ~/.gitconfigman/ directory if it doesn't exist, and saves your current global git config as the 'default' profile.
`
➜ ~ gitconfig-man -i
⚙️ Initializing Git Config Man...
✓ Created gitconfig-man directory: /Users/username/.gitconfigman
✓ Created default profile
✓ Activated 'default' profile
✨ Git Config Man initialized successfully!
`
With profile name:
``
➜ ~ gitconfig-man -c work
✓ Saved current git config to 'default' profile
✓ Created new profile: work
? Do you want to switch to newly created profile (work)? (Y/n) y
✓ Activated profile 'work'
Current git config has been cleared. Configure it using 'git config --global' commands.
Interactive mode (just run without name):
``
➜ ~ gitconfig-man -c
? Enter name for the new profile: personal
✓ Saved current git config to 'default' profile
✓ Created new profile: personal
? Do you want to switch to newly created profile (personal)? (Y/n)
After creating a new profile and switching to it, your global git config will be cleared. You can then configure it using standard git commands:
`bash`
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
git config --global core.editor "vim"... any other git config settings you need
`
➜ ~ gitconfig-man -ls
Available profiles:
• default
✓ work (active)
• personal
`
With profile name:
``
➜ ~ gitconfig-man -s default
✓ Saved current git config to 'work' profile
✓ Activated profile 'default'
Interactive mode with autocomplete (just run without name):
``
➜ ~ gitconfig-man -s
? Select profile to switch to: (Use arrow keys or type to search)
❯ default
personal
Start typing to filter profiles with autocomplete!
With profile name:
``
➜ ~ gitconfig-man -d work
✓ Successfully deleted profile 'work'
Interactive mode with autocomplete and confirmation (just run without name):
``
➜ ~ gitconfig-man -d
? Select profile to delete: (Use arrow keys or type to search)
❯ work
staging
? Are you sure you want to delete profile 'work'? (y/N) y
✓ Successfully deleted profile 'work'
``
➜ ~ gitconfig-man -v
gitconfig-man version 1.0.0
gitconfig-man works by:
1. Storing your git global configurations as JSON files in ~/.gitconfigman/profilename.json
2. Each profile is saved as
3. When you switch profiles, it:
- Saves your current git config to the active profile
- Clears all global git config settings
- Applies the settings from the new profile
This means all your git config --global settings are preserved and can be switched instantly!
`bashInitialize
gitconfig-man -i
$3
`bash
Profile for open source projects
gitconfig-man -c opensource
git config --global user.name "Your Name"
git config --global user.email "opensource@email.com"
git config --global core.editor "vim"Profile for client projects
gitconfig-man -c client
git config --global user.name "Professional Name"
git config --global user.email "client@company.com"
git config --global core.editor "nano"
`Requirements
---------------- Node.js >= 16.0.0
- npm >= 7.0.0
- Git installed and accessible via command line
Development
-----------$3
`bash
Run all tests
npm testRun tests in watch mode
npm run test:watchRun tests with coverage
npm run test:ci
`$3
`
gitconfig-man/
├── src/
│ ├── __tests__/ # Test files
│ ├── cli.js # CLI entry point
│ ├── cliOptions.js # CLI argument parsing
│ ├── commands.js # Command implementations
│ ├── constants.js # Constants and configuration
│ └── extendConfig.js # Git config utilities
├── .github/
│ └── workflows/ # GitHub Actions CI/CD
├── index.js # Main entry point
└── package.json
`$3
Contributions are welcome! Please feel free to submit a Pull Request.
1. Fork the repository
2. Create your feature branch (
git checkout -b feature/amazing-feature)
3. Commit your changes (git commit -m 'Add some amazing feature')
4. Push to the branch (git push origin feature/amazing-feature)
5. Open a Pull RequestLicense
----------ISC, a permissive free software license published by the Internet Software Consortium.
Notes
--------- The 'default' profile cannot be deleted
- You cannot delete the currently active profile
- All git config changes are saved automatically when switching profiles
- Profile files are stored in
~/.gitconfigman/` directory* GitHub (shahidullahkhankhattak)
* Email (shahid@shahidullahkhan.com)
---
Made with ❤️ for developers who manage multiple git identities by Shahid Ullah Khan from Pakistan.