ferris-git
Installation
SKILL.md
Git Repair and History
Before touching history
- Note the tip SHA of each branch you will move. The reflog recovers commits, not working-tree edits: after
reset --hard,restore,clean, orstash drop, only previously staged content survives, as dangling blobs (git fsck --lost-found). Commit or stash the user's work first. - There is no interactive editor. Use
--no-edit,commit --fixupwithrebase --autosquash, andrebase --onto; otherwise setGIT_SEQUENCE_EDITOR/GIT_EDITORto a non-interactive command. Stage partial hunks withgit apply --cached, notadd -p.
Conflicts
- Read both sides' intent first:
git log --merge -p -- <path>, andgit checkout --conflict=zdiff3 -- <path>to show the base. Wholesale--ours/--theirsis right only when one side is intentionally dropped. - Lockfiles and generated files: take one side, then regenerate with the owning tool from the merged inputs, without a blanket update.
- A clean textual merge can still be a semantic conflict; build and run checks covering both sides.
Requested rewrites
- Keep authorship and commit boundaries unless asked otherwise.
--update-refskeeps stacked branches attached. - Push with
--force-with-lease --force-if-includes, never bare--force. - In
git bisect run, exit 125 means skip; make setup failures exit 125 so they are not marked bad.