Git42 is a powerful yet simple tool that helps developers manage multiple Git identities with ease. Designed for users who work across multiple GitHub accounts, Git42 automates the management of SSH keys and Git user configurations, allowing for seamless switching between different identities. Whether you are handling multiple projects with distinct GitHub profiles or managing various SSH keys, Git42 streamlines the process.
- 🚀 One-Line Installation: Get started quickly with a single command.
- 👥 User Management: Easily add, remove, edit, and list users from a central database.
- 🔑 Multiple Profiles: Manage several Git user profiles, each with its own SSH key.
- 🔄 Seamless Switching: Instantly switch between GitHub accounts with one command.
- 🤖 Automated SSH Key Handling: Simplify authentication by automating SSH key management.
- 💻 Interactive CLI: Enjoy an intuitive command-line interface for hassle-free configuration.
Before using Git42, ensure you have:
- Bash Shell: Available on Linux, macOS, or Git Bash for Windows.
- Git: Confirm your installation with
git --version.
Install Git42 automatically by running:
bash <(curl -fsSL https://raw.githubusercontent.com/ababdelo/Git42/main/install.sh)To add a new Git user profile, execute the following command:
git42 addYou will be prompted to enter:
- Git username
- Git email
- SSH key path
Once entered, this user’s information is saved, and you can switch to them without re-entering these details in the future.
To delete a user profile, use the following command:
git42 rm <user_id>This will permanently remove the specified user from the database.
To modify a user’s details, such as username, email, or SSH key, run:
git42 edit <user_id>To view all registered users and their details, execute:
git42 listTo switch to a different user profile, use:
git42 setup <user_id>This command:
- Clears all currently added SSH keys.
- Adds the selected user's SSH key to the SSH agent.
- Update the global Git configuration to reflect the chosen user’s details.
To display the currently active Git user, use the following command:
git42 activeThis command will show the user that is currently set as the active Git user for your shell session, including their id and associated username. If no active user is configured, it will notify you that there is no active user.
To adjust Git42’s configuration settings, run:
git42 config You will be prompted to select an option from the available choices, such as:
- user_db <path/to/new_database>
Note: This feature is still in beta and currently only supports updating the database location.
Git42 requires an active SSH agent with its environment variables (especially SSH_AUTH_SOCK) exported in your current shell. You only need to start the SSH agent once per shell session. Once running, you can use Git42 commands without restarting the agent. However, if you open a new shell, remember to start the SSH agent again by running:
- SSH key fails to add: Ensure the SSH agent is running:
eval $(ssh-agent -s). - Cannot find a user: Run
git42 listto check stored users. - Git credentials incorrect: Run
git config --global --listto verify the applied settings.
This project is licensed under the ED42 Non-Commercial License v1.0. See the LICENSE file for more details.
Contributions and suggestions to enhance this project are welcome! Please feel free to submit a pull request or open an issue.
For any inquiries or collaboration opportunities, please reach out to me at:
Thanks for stopping by and taking a peek at my work!