-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: change Git config inside Docker container
- Loading branch information
Showing
3 changed files
with
19 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
|
||
# When running any git command inside a Docker container the user is different | ||
# than usual so Git thinks something fishy is going on. Git will print something | ||
# like: | ||
# | ||
# > fatal: detected dubious ownership in repository at '/workspace' | ||
# > To add an exception for this directory, call: | ||
# > | ||
# > git config --global --add safe.directory /workspace | ||
# | ||
# This script runs that command to avoid this error. | ||
|
||
set -ex | ||
if ! git config safe.directory | grep --quiet /workspace; then | ||
echo "Setting up Git safe directory" | ||
git config --global --add safe.directory /workspace | ||
fi |