Skip to content

Commit d52bd57

Browse files
committed
Add documentation workarounds for dubious ownership
1 parent b91085a commit d52bd57

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

docs/docs/connections/local-repos.mdx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,30 @@ The commit graph can be updated when fetching with `--write-commit-graph`:
9191
git fetch --write-commit-graph
9292
```
9393

94+
## Permission issues
95+
96+
When running a Sync Job on your local repositories, if you have a different user than the one that Sourcebot runs as
97+
(in Docker, the Sourcebot user is 1500:1500), you may encounter the following error:
98+
99+
```sh
100+
fatal: detected dubious ownership in repository at '/repos/org_name/repo_name.git'
101+
To add an exception for this directory, call:
102+
git config --global --add safe.directory /repos/org_name/repo_name.git.git
103+
```
104+
105+
As the code should be read-only by sourcebot, you can use the following [git-config environment variables](https://git-scm.com/docs/git-config#ENVIRONMENT)
106+
to allow Sourcebot to read from any repository, regardless of ownership:
107+
108+
```sh
109+
GIT_CONFIG_COUNT=1
110+
GIT_CONFIG_KEY_0=safe.directory
111+
GIT_CONFIG_VALUE_0=*
112+
```
113+
114+
If you're using docker-compose, this can be added to the `environment` section of the `sourcebot` service
115+
in the [docker-compose](https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/docker-compose.yml) file,
116+
otherwise you can set these environment variables in the environment where sourcebot is running.
117+
94118
## Schema reference
95119

96120
<Accordion title="Reference">

0 commit comments

Comments
 (0)