Skip to content

Commit 0732767

Browse files
mohsin-wiserclaude
andcommitted
fix: add explicit git safe.directory configuration
Adds git safe.directory configuration in post-create.sh to prevent ownership warnings in devcontainer and Coder workspaces. This ensures the workspace directory is marked as safe even before Coder's automatic configuration runs, preventing any permission warnings. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent a53783f commit 0732767

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

.devcontainer/post-create.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,20 @@ ensure_dir "$TARGET_HOME/.local/share"
8181
ensure_dir "$TARGET_HOME/.local/share/code-server"
8282
ensure_dir "$TARGET_HOME/.config/code-server"
8383

84+
# ============================================
85+
# Configure git safe directory
86+
# ============================================
87+
echo "🔧 Configuring git safe directory..."
88+
# Mark workspace as safe directory to avoid ownership warnings
89+
if [ "$(id -u)" = "0" ]; then
90+
# Running as root - configure for vscode user
91+
su - "$TARGET_USER" -c "git config --global --add safe.directory /workspaces/SimpleAccounts-UAE" 2>/dev/null || true
92+
else
93+
# Running as vscode user - configure directly
94+
git config --global --add safe.directory /workspaces/SimpleAccounts-UAE 2>/dev/null || true
95+
fi
96+
echo " ✅ Git safe directory configured"
97+
8498
# ============================================
8599
# Install npm dependencies
86100
# ============================================

0 commit comments

Comments
 (0)