Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Rewind file tracking backs up gitignored secret files; add an exclude or an off switch

未关闭
#5,172 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
42/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
shell
领域
cli, security

调研方向

The report identifies enableFileChangeTracking as the interactive CLI entry point and session-state/<session-id>/rewind-file-snapshots/backups/ plus index.json as the affected output. Start by tracing how the CLI enables tracking and how the tracker selects and writes files; the issue does not name source files or tests. Done means secret-file backups can be excluded or tracking disabled, and backups use mode 600.

由索引模型根据 Issue 内容生成。

描述

area:sessions

Version: Copilot CLI 1.0.91, Linux x64, interactive mode.

What happens

Since /rewind became git-free (1.0.78), the CLI saves the earlier content of every file that a turn changes under the session's working directory into session-state/<session-id>/rewind-file-snapshots/backups/. Gitignored files are included. When the agent edits a .env file in a turn (for example to rotate an API token), the old file, with every secret in it, stays in session state as a plain file at mode 644. It stays there after the session ends.

A session with one long autonomous turn has one snapshot, so every file that turn changes is held in that snapshot.

What I checked

  • copilot help config, copilot help environment and copilot --help name no setting, flag or variable for rewind file tracking. respectGitignore covers only the @ file picker.
  • The interactive CLI starts each session with enableFileChangeTracking set to true as a constant. Only SDK clients can pass the option.
  • The tracker skips a file only for its size, a non-regular file or an unverifiable identity. It does not skip files that .gitignore excludes or files that hold secrets.

Steps to reproduce

  1. In a git repository, put .env.local in .gitignore and give it a line such as EXAMPLE_TOKEN=old-value.
  2. Start copilot in that repository and ask it to change the value to new-value with a shell command.
  3. List session-state/<session-id>/rewind-file-snapshots/backups/. One file holds EXAMPLE_TOKEN=old-value, and index.json maps it to .env.local.

Expected

A secret file that Copilot edits does not stay copied in session state. Any one of these would do:

  1. Skip files that .gitignore excludes, or files that match .env*, when the tracker saves earlier content. /rewind then lists them as not restorable.
  2. A setting, for example rewind.excludePatterns, that takes path patterns the tracker skips.
  3. A setting or flag that turns off file tracking, leaving conversation-only rewind.

Also: write the backups at mode 600, the same as the other session files.

主要语言
Shell
星标
11.3k
派生
2k
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/copilot-cli 的其他 Issue

查看 github/copilot-cli 的全部 Issue

相似的 Issue

更多 Shell/Bash Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。