From e8165041d9d109b631a17454052e5d4a5cbacefc Mon Sep 17 00:00:00 2001 From: Andrejus Date: Tue, 24 Feb 2026 19:02:28 +0000 Subject: [PATCH] fix: codespaces gitconfig override --- home/.gitconfig | 5 ++--- home/.gitconfig.local | 3 +++ install.d/23-stow.sh | 6 ++++++ 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 home/.gitconfig.local diff --git a/home/.gitconfig b/home/.gitconfig index e0604f9..1121534 100644 --- a/home/.gitconfig +++ b/home/.gitconfig @@ -1,6 +1,5 @@ -[user] - name = Andrejus - email = git@andrejus.uk +[include] + path = ~/.gitconfig.local [github] user = andrejusk diff --git a/home/.gitconfig.local b/home/.gitconfig.local new file mode 100644 index 0000000..b02bec6 --- /dev/null +++ b/home/.gitconfig.local @@ -0,0 +1,3 @@ +[user] + name = Andrejus + email = git@andrejus.uk diff --git a/install.d/23-stow.sh b/install.d/23-stow.sh index c25d673..d3c9c15 100755 --- a/install.d/23-stow.sh +++ b/install.d/23-stow.sh @@ -30,6 +30,7 @@ root_dir=${DOTFILES:-$(dirname "$(dirname "$(dirname "$(realpath "$0")")")")} rm -f "$HOME/.bash_profile" rm -f "$HOME/.bashrc" rm -f "$HOME/.gitconfig" +rm -f "$HOME/.gitconfig.local" rm -f "$HOME/.profile" rm -f "$HOME/.zshrc" rm -f "$HOME/.p10k.zsh" @@ -40,6 +41,11 @@ mkdir -p "$HOME/.ssh" stow --dir="$root_dir" --target="$HOME" home +# In Codespaces, remove .gitconfig.local so the auto-provisioned identity is used +if [[ "$DOTS_ENV" == "codespaces" ]]; then + rm -f "$HOME/.gitconfig.local" +fi + # Bust PATH cache to force rebuild with new profile rm -f "${XDG_CACHE_HOME:-$HOME/.cache}/dots/path"