Conversation
There was a problem hiding this comment.
Pull request overview
Adds Git safe.directory configuration during CD deployments to avoid “dubious ownership” errors when syncing the VM’s repo before running deployment steps.
Changes:
- Configure Git
safe.directoryfor$DEPLOY_PATHin the deploy SSH script. - Apply the configuration at both global and system Git config levels (with errors ignored).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| git config --global --add safe.directory "$DEPLOY_PATH" || true | ||
| sudo git config --system --add safe.directory "$DEPLOY_PATH" || true |
There was a problem hiding this comment.
Using git config --global --add safe.directory (and especially sudo git config --system --add ...) on every deploy will keep appending duplicate safe.directory entries to ~/.gitconfig and /etc/gitconfig, and it permanently mutates host configuration. Prefer a non-persistent approach (e.g., run the fetch/checkout/pull with git -c safe.directory="$DEPLOY_PATH" ...), or at least use --replace-all / guard so the value is only set once. Also consider dropping the --system write unless there’s a confirmed need to modify /etc/gitconfig.
No description provided.