-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
questionFurther information is requestedFurther information is requested
Description
As my git directory is located on a different server with different users, I got an "unsafe git directory" warning. I currently work around this using the following in my .yml (docker swarm):
command: sh -c "git config --global --add safe.directory /var/lib/git/repositories/myrepo.git && \
sed -i 's/index gitweb.cgi;/rewrite ^ \\/gitweb.cgi?$query_string break;/' /etc/nginx/conf.d/nginx.conf && \
nginx -g 'daemon off;'"
This script does two things:
- It allows any URL to be redirected to gitweb. That's just a nice to have on my side. Just personal.
- Adds myrepo.git to the safe.directory list.
According to https://stackoverflow.com/questions/71849415/i-cannot-add-the-parent-directory-to-safe-directory-in-git you can also add '*' to safe directories.
Perhaps there should be either:
- Documentation on how to
A. Fix this issue, or,
B. use this workaround - Just a global git config to disable the safe directory check, or
- an environment option to add safe directores?
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested