2.8 KiB
Kamaz Cleaner Telemetry Commit With Mass Deletions
Summary
On qore, C:\git\Kamaz_Cleaner had main and origin/main at commit 465385495 with message fix(telemetry): gears bitmask SelectInt B=0, HTTP status async callback, delegate bind order.
Despite the telemetry commit message, the commit removed almost the entire previous 642e6f0e4 snapshot. The resulting tree had only three tracked files:
Kamaz_Cleaner.uprojectContent/CityPark/Kamaz/Telemetry/BP_TelemetrySender_Component.uassetContent/CityPark/Kamaz/model/KamazBP.uasset
The working tree still contained many untracked files, which made the repository look like a full project locally while the tracked history was mostly empty.
Symptoms
git status --short --branch --untracked-files=nolooked clean.git ls-tree -r --name-only HEAD | Measure-Object -Linereported only 3 tracked files.git log --name-status -1showed a very large list of deleted files.- A normal push of
mainwould preserve the risky deletion state.
Root Cause
The local main commit was likely created from a partial index or a working tree with most files not staged/tracked. The commit message was telemetry-specific, but the tree state was not.
Safe Recovery Used
A safe commit was created without modifying the working tree by using a temporary Git index:
- Start from parent snapshot
642e6f0e4. - Import only telemetry-related blobs from
465385495:Content/CityPark/Kamaz/Telemetry/BP_TelemetrySender_Component.uassetContent/CityPark/Kamaz/model/KamazBP.uassetKamaz_Cleaner.uproject
- Create commit
810063520 fix(telemetry): isolate Kamaz telemetry updates. - Push it as branch
telemetry-only-main.
Verification:
git diff --name-status 642e6f0e4 telemetry-only-main
Expected output:
A Content/CityPark/Kamaz/Telemetry/BP_TelemetrySender_Component.uasset
M Content/CityPark/Kamaz/model/KamazBP.uasset
M Kamaz_Cleaner.uproject
Current State
- Bare repo:
ssh://qore@192.168.1.66/srv/git/Kamaz_Cleaner.git - Risky branch:
main->465385495 - Safe branch:
telemetry-only-main->810063520
Replacing main with the safe branch requires --force-with-lease and explicit user approval because it rewrites the remote branch.
Prevention
- Never trust a commit message alone when a repository has many untracked files.
- Before pushing telemetry-only changes, check:
git diff --name-status <base> HEAD
git ls-tree -r --name-only HEAD | Measure-Object -Line
git status --short --branch --untracked-files=no
- Stage only explicit files; never use
git add .inKamaz_Cleaner. - If a local commit accidentally contains mass deletions, construct a clean commit from the last good base and explicitly selected blobs rather than trying to patch the bad commit in place.