git-upstream-sync
Skill120 starsChanged 14 days agoMITView on GitHub
The only way to merge origin/main into a branch, conflicts or not. Use it every time main comes in — a PR reported conflicting or DIRTY, a branch behind origin/main, a CI failure to reproduce on the merged tree. Never run `git merge origin/main` or `git pull origin main` by hand.
In this repository37 other files it gives its agents.
- AGENTS.mdAGENTS.md
- benchmark/AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- package-gale/AGENTS.mdAGENTS.md
- package-grog/AGENTS.mdAGENTS.md
- package-jade/AGENTS.mdAGENTS.md
- package-loam/AGENTS.mdAGENTS.md
- package-re/AGENTS.mdAGENTS.md
- package-wadopoet/AGENTS.mdAGENTS.md
- wado-cli/AGENTS.mdAGENTS.md
- wado-compiler/AGENTS.mdAGENTS.md
- wado-from-idl/AGENTS.mdAGENTS.md
- wado-host/AGENTS.mdAGENTS.md
- wado-lsp/AGENTS.mdAGENTS.md
- wado-manifest/AGENTS.mdAGENTS.md
- wado-run-pjrt/AGENTS.mdAGENTS.md
- wado-run-webgpu/AGENTS.mdAGENTS.md
- wado-vscode/AGENTS.mdAGENTS.md
- benchmarkSkill
- ci-timingSkill
- code-review-responseSkill
- coverage-investigationSkill
- crSkill
- debuggerSkill
- distillSkill
- jcoSkill
- markdownSkill
- on-task-doneSkill
- optimizer-debugSkill
- profiling-wado-compilerSkill
- pull-requestSkill
- rust-renameSkill
- rustSkill
- vendor-submodulesSkill
- wado-cliSkill
- wado-performanceSkill
- wasm-optSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 5 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
If the branch is on origin, pull it first: CI's tidy job may have pushed chore: tidy onto it.
- Distinctive: line 32
If the merge produces conflicts, commit the conflict markers without resolving them first.
- Distinctive: line 51
After committing the unresolved state:
- Distinctive: line 53
Read each conflicted file and understand both sides of the conflict
- Very specific: line 72
Always use -c merge.conflictstyle=zdiff3 so the merge base is visible in conflict markers (with zealous zdiff3 reducing noise)
- Distinctive: line 73
Always commit the unresolved conflicts first, then resolve in a separate commit — this preserves a clear record of what the conflicts …
- Distinctive: line 74
Do NOT squash the two commits together
- Very specific: line 80
Do not skip them or defer them to on-task-done / CI.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Overview
Merge origin/main into the current branch. Follow every step whether or not the merge conflicts: a clean merge still ends with the sanity check.
Procedure
1. Fetch and merge with zdiff3
If the branch is on origin, pull it first: CI's tidy job may have pushed
chore: tidy onto it. If that pull conflicts, take it through steps 2 and 3,
then start again here, so origin/main is merged too. Then move the checked-out submodules to the pointers the
merge recorded, so the next git add -A does not stage a stale checkout.
b=$(git branch --show-current)
if git ls-remote --exit-code --heads origin "$b" > /dev/null; then
git pull --no-rebase origin "$b" || exit 1 # a conflict stops here
fi
git fetch origin main
git -c merge.conflictstyle=zdiff3 merge origin/main
git submodule update --recommend-shallow2. If conflicts exist, commit them as-is
If the merge produces conflicts, commit the conflict markers without resolving them first. This records the raw conflict state in a dedicated commit, separate from the resolution.
git add -A
git diff --cached origin/main -- vendor
git commit -m "merge origin/main (conflicts unresolved)"The vendor diff prints nothing unless the branch bumps a submodule itself.
Anything else is a stale checkout that git add -A staged, reverting main's
bump. Restore main's pointer for each such path before committing, and check
again after every git add -A, step 3's included:
git update-index --cacheinfo 160000,"$(git rev-parse origin/main:vendor/wasmtime)",vendor/wasmtime3. Resolve conflicts
After committing the unresolved state:
- Read each conflicted file and understand both sides of the conflict
- Resolve conflicts in code files (remove conflict markers, choose correct code)
- For generated files (golden fixtures, generated parsers, …) that conflict, regenerate them by re-running their generator and commit the fresh output — do not hand-resolve the markers or defer them (see "Generated files" below)
- Stage and commit the resolution:
git add -A
git diff --cached origin/main -- vendor # as in step 2
git commit -m "resolve merge conflicts"4. Run mise run test for sanity check
CI applies clippy and format, so a quick sanity check is sufficient.
Important
- Always use
-c merge.conflictstyle=zdiff3so the merge base is visible in conflict markers (with zealous zdiff3 reducing noise) - Always commit the unresolved conflicts first, then resolve in a separate commit — this preserves a clear record of what the conflicts looked like vs how they were resolved
- Do NOT squash the two commits together
Generated files
- Always regenerate golden / generated files and commit.
Re-run the generator (do not hand-resolve the markers) and commit its output.
Do not skip them or defer them to
on-task-done/ CI. - Never silently discard generated output (e.g.
git restoreto clean the tree or quiet a hook). Commit it, or ask. Discarding generated work without asking is always wrong.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

