A proof-first 4-minute flow to find out which version is current before you overwrite good work.
If you open a file in GitHub and it looks different from what your agent sees in workspace, don’t panic and don’t overwrite yet. Most mismatches are simple context or sync issues.
You’re often comparing two different states: local workspace edits, remote branch history, or even a different account/repo path.
Run these checks in the workspace root:
git status --short
git branch --show-current
git log --oneline -n 5 -- path/to/file.md
Do not ask the agent to edit until you can prove the exact active file path and current branch in one message.
Before editing anything, prove context first:
1) Return current repo path and active branch.
2) Return exact absolute file path you will edit.
3) Quote lines 1-3 from that file.
4) Return git status --short only for that file.
If any mismatch exists, stop and explain the mismatch class (local ahead / remote ahead / wrong context).
Very common. Always use absolute path proof, not filename-only proof.
This looks like data loss but is usually just branch mismatch.
If behavior feels random, confirm you’re logged into the same account/workspace in both places before any edits.
If git branch --show-current returns nothing, you’re not on a normal branch. You may be viewing an old commit snapshot. Switch back to your working branch before editing.
If Git says merge/rebase is in progress, stop file edits and finish or abort that operation first. Partial merge state can make file content look inconsistent between local and GitHub.
Confirm git remote -v. Many mismatches are local changes tracked against a fork while GitHub browser is opened on upstream (or vice versa).
git branch --show-current + git rev-parse --short HEAD + absolute file path + first 3 lines of file. If any one of these differs from your expected target, stop and re-align context first.
Never paste tokens or secrets when sharing diagnostics. Share path/branch/commit info only.