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
{{ message }}
Repository navigation
Root-scope first pull overwrites local config.yaml when the remote tracks it #353
At git_root: root, config.yaml is machine-local and kept out of the repository by the scope-aware .gitignore (internal/git/scope.go, WriteScopeGitignore). If the remote nevertheless tracksconfig.yaml (a legacy repo, a manual commit, or a remote created before switching to root scope), the first pull on another machine silently overwrites the local config.yaml with the remote copy.
Git treats ignored files as expendable, so this happens on both first-pull paths in FirstPull (internal/git/info.go):
merge (merge --allow-unrelated-histories): succeeds and replaces the ignored local file;
reset (pull --force, or a scaffold-only repo): reset --hard replaces it.
The command that triggers it finishes with the already-loaded in-memory config, so nothing looks wrong until the next invocation reads the remote's config.yaml (wrong targets, paths, MCP/plugin/hook settings for this machine).
A first pull never replaces this machine's config.yaml. Options to consider:
refuse the first pull at root scope when the remote tree contains config.yaml, with guidance (untrack it on the remote via push's root-scope safety sweep, then pull); or
back up config.yaml before integrating and restore it afterwards, then report that the remote tracks it.
Context
Found while reviewing #352 (first pull keeping files-only local commits). It is pre-existing behavior and was deliberately left out of that PR.
Activity
fix(pull): keep the local config.yaml when a later pull brings a trac…