Skip to content

Instantly share code, notes, and snippets.

@Aina261
Last active May 26, 2022 14:12
Show Gist options
  • Select an option

  • Save Aina261/8a6bc2e083d03adc5efd673ce34e3c9d to your computer and use it in GitHub Desktop.

Select an option

Save Aina261/8a6bc2e083d03adc5efd673ce34e3c9d to your computer and use it in GitHub Desktop.
Git config conditional includes
- mkdir ~/work_dir_company
- nano ~/work_dir_company/.gitignore_company
```
[user]
email = user@mail.com
name = userName
[core]
sshCommand = ssh -i ~/.ssh/id_ed25519_company
```
- nano ~/.gitconfig
```
[includeIf "gitdir:~/work_dir_company/"]
path = ~/work_dir_company/.gitignore_company
[user]
email = user@mail.com
name = userName
[core]
sshCommand = ssh -i ~/.ssh/id_ed25519_company
```
- Verify with `git config --list`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment