gh-authswap
is a GitHub CLI extension that allows you to switch authentication contexts and automatically update your .gitconfig
with the correct user name and email.
- Switch between multiple GitHub authentication contexts.
- Automatically fetch and update your
.gitconfig
with the current user's name and email. - Simplifies managing multiple GitHub profiles (e.g., work and personal).
To install the gh-authswap
extension, run this:
```sh
gh extension install khaled-0/gh-authswap
```
To switch authentication contexts and update your .gitconfig
, use the following command:
gh authswap
To switch to a work
context:
gh authswap work
Or to switch to a personal
context:
gh authswap personal
- If the email address is
null
despite having theuser:email
scope, it is likely because the you have set your email address to private. Check this guide to solve the issue
Contributions are welcome! Please open an issue or submit a pull request with your changes.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or support, please open an issue on the repository.