Skip to content

Instantly share code, notes, and snippets.

@jonatassaraiva
Last active July 7, 2021 17:08
Show Gist options
  • Save jonatassaraiva/d641c0417429e9bd0c324f538decc0f5 to your computer and use it in GitHub Desktop.
Save jonatassaraiva/d641c0417429e9bd0c324f538decc0f5 to your computer and use it in GitHub Desktop.
Config Mult GIT
# Existing SSH keys
> ls -al ~/.ssh
# Generate id_rsa
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
# Copy the SSH key to your clipboard.
> pbcopy < ~/.ssh/id_rsa.pub
# Generate id_rsa devops
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
# Copy the SSH key to your clipboard.
> pbcopy < ~/.ssh/id_rsa_devops.pub
# ~/.ssh/config
# Personal account, - the default config
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa
# Work id_rsa_devops devops
Host ssh.dev.azure.com
HostName ssh.dev.azure.com
User git
IdentityFile ~/.ssh/id_rsa_devops
[alias]
undo = reset --soft HEAD~1
st = status
[user]
name = <ame>
email = <email>
[includeIf "gitdir:~/workspace/work/"]
path = ~/workspace/work/.gitconfig-work
[user]
name = <name>
email = <work-email>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment