Skip to content

Commit a751953

Browse files
committed
Add detailed comments to .gitconfig explaining the fix
Clarifies why this configuration is needed to fix the Git 'dubious ownership' issue that occurs in Podman container environments where the mount point directory has different ownership than the files inside it. Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
1 parent a093670 commit a751953

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

.gitconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,16 @@
1+
# Git configuration for containerized builds
2+
#
3+
# This file fixes VCS stamping errors in Podman container environments.
4+
# When Docker/Podman mounts the repository, the mount point directory
5+
# (/github.com/vmware-tanzu/velero) is owned by root:root but the files
6+
# inside are owned by the mapped user. This ownership mismatch triggers
7+
# Git's "dubious ownership" security feature (introduced in Git 2.35.2+)
8+
# which causes git operations to fail with exit code 128.
9+
#
10+
# The safe.directory configuration tells Git to trust this specific
11+
# directory path, allowing VCS stamping and other git operations to
12+
# work properly in containerized builds.
13+
#
14+
# See: https://github.com/vmware-tanzu/velero/issues/9004
115
[safe]
216
directory = /github.com/vmware-tanzu/velero

0 commit comments

Comments
 (0)