Skip to content

Commit bc7e6d6

Browse files
committed
docs: update readme with git configuration information
1 parent be82a78 commit bc7e6d6

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,41 @@ To make sure `j k h l` run on hold, you need to run the following command on Mac
7575
`defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false`
7676

7777
You can read more about this on [VSCodium/VIM's Readme](https://github.com/VSCodeVim/Vim/blob/master/README.md#mac-setup)
78+
79+
## Git Configuration
80+
81+
Here are some helpful links around git configuration.
82+
83+
* https://gist.github.com/edwhad/a25f728e6add3f6d1f7a483810e9d555
84+
* https://developer.1password.com/docs/ssh/agent/advanced/#use-multiple-github-accounts
85+
86+
This is usually per-device, but I generally use 1Password to manage my SSH keys.
87+
When different SSH keys for different instances are necessary, I usually setup a
88+
directory structure for cloning repositories which map to my keys.
89+
90+
91+
My config ends up looking something like:
92+
93+
```
94+
95+
[user]
96+
email = <my-email>
97+
name = Adriel Perkins
98+
99+
[includeIf "gitdir:~/path/to/some-org/"]
100+
path = ~/path/to/some-org/.gitconfig
101+
102+
```
103+
104+
Then my `.gitconfig` in the `some-org` directory looks like:
105+
106+
```
107+
[user]
108+
email = <some other email>
109+
name = Adriel Perkins
110+
111+
[core]
112+
; Must point to public key for the 1Pass SSH Agent to handle private.
113+
sshCommand = ssh -i ~/.ssh/some-org.pub
114+
115+
```

0 commit comments

Comments
 (0)