Skip to content

Commit c484929

Browse files
document gitbutler.storagePath
Document where per-project GitButler state lives and how to override it, including the channel-specific config keys and path constraints. Motivation: make the new storage path setting discoverable in the debugging docs for users who need to inspect or relocate repository-local GitButler state. Refs: gitbutlerapp/gitbutler#12646 Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
1 parent e21f4d7 commit c484929

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

content/docs/development/debugging.mdx

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,54 @@ The `settings.json` are some top level preferences you've set.
151151

152152
Finally, the `keys` directory holds the SSH key that we generate for you in case you don't want to go through creating your own. It's only used if you want to use it to sign commits or use it for authentication.
153153

154+
### Per-project repository data
155+
156+
Most repository-specific GitButler state lives next to the repository itself, inside the `.git` directory. By default, GitButler stores that data in `.git/gitbutler` for
157+
release builds, nightly builds and developer builds.
158+
159+
You can override that location with a Git config change, here for the stable build:
160+
161+
```bash title="Terminal"
162+
❯ git config --local gitbutler.storagePath gitbutler-alt
163+
```
164+
165+
You can also set it globally if you want all repositories opened by GitButler on that machine to use the same base configuration:
166+
167+
Setting it to a shared directory is useful if the project locations themselves are on a filesystem that doesn't support Sqlite very well,
168+
like a network drive.
169+
170+
```bash title="Terminal"
171+
❯ git config --global gitbutler.storagePath /path/to/gitbutler-projects
172+
```
173+
174+
Setting it to a relative path would force a channel, like Nightly, to reuse the data of stable builds.
175+
176+
```bash title="Terminal"
177+
❯ git config --global gitbutler.nightly.storagePath gitbutler
178+
```
179+
180+
The Git config key depends on the app channel:
181+
182+
- Release builds use `gitbutler.storagePath`
183+
- Nightly builds use `gitbutler.nightly.storagePath`
184+
- Developer builds use `gitbutler.dev.storagePath`
185+
186+
There are a couple of constraints on the configured path:
187+
188+
- Relative paths are resolved relative to the repository's `.git` directory
189+
- If the resolved path stays inside `.git`, it must be under a top-level directory whose name starts with `gitbutler`, case-insensitive
190+
- You cannot point it at `.git` itself
191+
- If the resolved path ends up outside `.git`, GitButler appends a project-path specific identifier so multiple repositories can share the same base directory safely
192+
193+
For example, these are valid:
194+
195+
```bash title="Terminal"
196+
❯ git config --local gitbutler.storagePath gitbutler-alt
197+
❯ git config --local gitbutler.storagePath ../../gitbutler-projects
198+
```
199+
200+
If you use a path outside `.git`, GitButler treats it as a base directory. For example, `../../gitbutler-projects` becomes something like `../../gitbutler-projects/<project-handle>` after resolution.
201+
154202
## Linux
155203

156204
### `glibc` Errors

0 commit comments

Comments
 (0)