Skip to content

Commit 256e3f7

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 256e3f7

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

content/docs/development/debugging.mdx

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,57 @@ 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:
157+
158+
- `.git/gitbutler` on release builds
159+
- `.git/gitbutler.nightly` on nightly builds
160+
- `.git/gitbutler.dev` on developer builds
161+
162+
You can override that location with a Git config key:
163+
164+
```bash title="Terminal"
165+
❯ git config --local gitbutler.storagePath gitbutler-alt
166+
```
167+
168+
You can also set it globally if you want all repositories opened by GitButler on that machine to use the same base configuration:
169+
170+
Setting it to a shared directory is useful if the project locations themselves are on a filesystem that doesn't support Sqlite very well,
171+
like a network drive.
172+
173+
```bash title="Terminal"
174+
❯ git config --global gitbutler.storagePath /path/to/gitbutler-projects
175+
```
176+
177+
Setting it to a relative path would force a channel, like Nightly, to reuse the data of stable builds.
178+
179+
```bash title="Terminal"
180+
❯ git config --global gitbutler.nightly.storagePath gitbutler
181+
```
182+
183+
The config key depends on the app channel:
184+
185+
- Release builds use `gitbutler.storagePath`
186+
- Nightly builds use `gitbutler.nightly.storagePath`
187+
- Developer builds use `gitbutler.dev.storagePath`
188+
189+
There are a couple of constraints on the configured path:
190+
191+
- Relative paths are resolved relative to the repository's `.git` directory
192+
- If the resolved path stays inside `.git`, it must be under a top-level directory whose name starts with `gitbutler`, case-insensitive
193+
- You cannot point it at `.git` itself
194+
- 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
195+
196+
For example, these are valid:
197+
198+
```bash title="Terminal"
199+
❯ git config --local gitbutler.storagePath gitbutler-alt
200+
❯ git config --local gitbutler.storagePath ../../gitbutler-projects
201+
```
202+
203+
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.
204+
154205
## Linux
155206

156207
### `glibc` Errors

0 commit comments

Comments
 (0)