https://github.com/phx/gitswitch
Easily alternate between multiple git identities and SSH keys
https://github.com/phx/gitswitch
Last synced: 11 months ago
JSON representation
Easily alternate between multiple git identities and SSH keys
- Host: GitHub
- URL: https://github.com/phx/gitswitch
- Owner: phx
- Created: 2022-03-14T15:27:17.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-04-14T14:28:57.000Z (about 4 years ago)
- Last Synced: 2025-03-24T04:41:11.671Z (about 1 year ago)
- Language: Shell
- Size: 1000 Bytes
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gitswitch
## This repository is no longer maintained.
`gitswitch` now uses a configuration file and has been merged into [phxutils](https://github.com/phx/phxutils).
The new location is [https://github.com/phx/phxutils/tree/master/gitswitch](https://github.com/phx/phxutils/tree/master/gitswitch).
## Old information:
Dependencies:
- `/bin/sh`
- `git`
Easy method for managing multiple `git` identities without changing your normal git paths/commands/configs/etc.
Edit the script as necessary to include your preferred ssh keys, names, and emails.
You can further edit the script to include swapping by profile name, but I will simply switch between 2 identities.
**NOTE:** This script uses `git config --global user.name` and `git config --global user.email`. If you prefer, feel free to alter the script to not use the `--global` flag.
## Requirements:
Included in `~/.ssh/config`:
```
# BEGIN GIT
Host github.com
HostName github.com
User git
IdentityFile /path/to/rsa_private_key
# END GIT
```
(or whatever git server you are using - just make sure the comments are there.)