Split gitconfig in work and personal use

This commit is contained in:
Christoffer Martinsson 2024-10-13 11:47:35 +02:00
parent e8310c4705
commit 9e43aac020
4 changed files with 21 additions and 4 deletions

View File

@ -1,3 +1,11 @@
# default to personal config
[include]
path = ~/.gitconfig.personal
# when working on work projects
[includeIf "gitdir:**/work/**/.git"]
path = ~/.gitconfig.work
[credential]
helper = cache
[credential "https://dev.azure.com"]
@ -5,11 +13,8 @@
[credential "https://git.cmtec.se"]
helper = store
username = cm
[user]
name = Christoffer Martinsson
email = cm@cmtec.se
[pull]
rebase = false
rebase = false
[merge]
tool = nvimdiff
[mergetool]

3
gitconfig.personal Normal file
View File

@ -0,0 +1,3 @@
[user]
name = Christoffer Martinsson
email = cm@cmtec.se

7
gitconfig.work Normal file
View File

@ -0,0 +1,7 @@
[user]
name = Christoffer Martinsson
email = christoffer.martinsson@mildef.com
[credential "https://git.mildef.com"]
helper = store
username = christoffer

View File

@ -328,6 +328,8 @@ ln -sf ~/code_server/config/nvim/init.lua ~/.config/nvim/init.lua
# Symlink git config
printf -- '\033[33m Symlinking git config\n\033[37m'
ln -sf ~/code_server/gitconfig ~/.gitconfig
ln -sf ~/code_server/gitconfig.personal ~/.gitconfig.personal
ln -sf ~/code_server/gitconfig.work ~/.gitconfig.work
# Symlink tmux config
printf -- '\033[33m Symlinking tmux config\n\033[37m'