You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/local-mount/CHANGELOG.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
7
7
## [Unreleased]
8
8
9
-
_No unreleased changes._
9
+
### Added
10
+
-`MountOptions.includeGit` (also exposed on `launchOnMount`) opts the project's `.git` directory back into the mount with one-way project→mount sync. Git operations work inside the mount; mount-side `.git` mutations stay sandboxed and are discarded on cleanup. Fixes [#66](https://github.com/AgentWorkforce/relayfile/issues/66).
Copy file name to clipboardExpand all lines: packages/local-mount/README.md
+23-1Lines changed: 23 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ Behavior:
29
29
- Copies regular files into the mount
30
30
- Applies ignore rules from `ignoredPatterns`
31
31
- Marks read-only matches as mode `0o444`
32
-
- Excludes `.git` and `node_modules` by default
32
+
- Excludes `.git` and `node_modules` by default. Pass `includeGit: true` to opt the project's `.git` directory back in (see [Including `.git`](#including-git))
33
33
- Writes `_MOUNT_README.md` and `.relayfile-local-mount` into the mount
34
34
- Skips syncing `_MOUNT_README.md`, `.relayfile-local-mount`, ignored files, read-only files, and symlinks back to the source project
35
35
@@ -110,6 +110,28 @@ Conflict and delete rules:
110
110
- readonly paths never flow mount→project; project-side edits still flow into the mount (the mount copy is re-chmodded `0o444`)
111
111
-`_MOUNT_README.md`, `.relayfile-local-mount`, ignored paths, and excluded directories never cross
112
112
113
+
## Including `.git`
114
+
115
+
By default, the project's `.git` directory is excluded from the mount, which means git commands inside the mount fail with `fatal: not a git repository`. Pass `includeGit: true` (on `createMount` or `launchOnMount`) to copy `.git` into the mount with **one-way project→mount sync**:
116
+
117
+
-`.git` is copied on mount creation, so `git status`, `git log`, `git diff`, `git commit`, etc. all work inside the mount.
118
+
- Project-side changes under `.git/**` flow into the mount (e.g. if a teammate's tooling moves `HEAD` while the agent is running).
119
+
- Mount-side changes under `.git/**` are **not** synced back to the project. Branches, commits, or refs the agent creates in the mount stay sandboxed and are discarded on cleanup.
120
+
121
+
If the agent needs its commits to survive, push to a remote from inside the mount. Source files outside `.git` continue to follow the normal bidirectional sync rules.
122
+
123
+
```ts
124
+
launchOnMount({
125
+
cli: 'claude',
126
+
args: ['--print', 'Inspect the diff and propose a fix.'],
127
+
projectDir,
128
+
mountDir,
129
+
includeGit: true,
130
+
});
131
+
```
132
+
133
+
Note that `.git` can be sizable (hundreds of MB on long-lived repos); the initial mount creation copies the whole tree.
134
+
113
135
## Dotfile semantics
114
136
115
137
`@relayfile/local-mount` uses glob-style patterns, powered by [`ignore`](https://www.npmjs.com/package/ignore).
0 commit comments