From 9e43aac020bb046b1387caf0a8ea830a73671356 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Sun, 13 Oct 2024 11:47:35 +0200 Subject: [PATCH] Split gitconfig in work and personal use --- gitconfig | 13 +++++++++---- gitconfig.personal | 3 +++ gitconfig.work | 7 +++++++ update.sh | 2 ++ 4 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 gitconfig.personal create mode 100644 gitconfig.work 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'