diff --git a/gitconfig b/gitconfig index e1a2ca2..021cb3f 100644 --- a/gitconfig +++ b/gitconfig @@ -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] diff --git a/gitconfig.personal b/gitconfig.personal new file mode 100644 index 0000000..ef3b31b --- /dev/null +++ b/gitconfig.personal @@ -0,0 +1,3 @@ +[user] + name = Christoffer Martinsson + email = cm@cmtec.se diff --git a/gitconfig.work b/gitconfig.work new file mode 100644 index 0000000..ddcd521 --- /dev/null +++ b/gitconfig.work @@ -0,0 +1,7 @@ +[user] + name = Christoffer Martinsson + email = christoffer.martinsson@mildef.com + +[credential "https://git.mildef.com"] + helper = store + username = christoffer diff --git a/update.sh b/update.sh index 993efcb..4501a90 100755 --- a/update.sh +++ b/update.sh @@ -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'