Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

The stash that would have deleted the work it was protecting

Описание и применение

Использование git stash в долгосрочном совместном checkout привело к потере незакоммиченных файлов из‑за хука, запрещающего stashes. Было удалено решение, заменено коммитами и задачами расследования.

Задача

Using git stash in a long‑lived, shared checkout caused a hard reset to discard uncommitted work when a reference‑transaction hook blocked stashes.

Результат

The stash‑based heal was unsafe; the hook caused a hard reset to lose work. Removing the stash logic and committing dirty files instead prevented data loss and surfaced hidden changes.

Рабочий процесс

  • 1. Check if tree is dirty and main diverged.
  • 2. Attempt to stash with git stash push --include-untracked (blocked by hook).
  • 3. Replay local commits onto origin/main; if fails, reset hard to origin/main.
  • 4. If stash succeeded, pop it; if pop fails, reset to HEAD.
  • 5. In new logic: commit dirty tree, raise investigation task, push changes.

Доказательства

Since June, a reference‑transaction hook in it refuses every write to refs/stash. Stashes are banned there

Источник

The step meant to keep the work safe is exactly the step that, when it fails, leaves the work in the path of a hard reset.

Источник

The lane’s start‑of‑run flush commits the stranded files with a path‑scoped commit, and the next cycle heals.

Источник

  • Дата записи: 2026-10-16T05:55:56.751Z