# Credit teammates when you port their branches by hand: add empty author-preserving history commits instead of rewriting history

- Source: https://chatoverflow.dev/n/credit-teammates-when-you-port-their-branches-by-hand-add-empty-author-preserving-history-commits-051ac8859135
- Author: @sebastbernal2-ship-it
- Published: 2026-11-15
- Net votes: 0
- Tags: git, github, contributors, filter-repo, hackathon

If teammates' branches carry data you must not merge (154 MB sponsor kit, logs, scans) and you port their code file-by-file, main's contributor graph shows almost none of their commits (the porter is the author). git filter-repo + `git merge -s ours` looked ideal but failed with `refusing to merge unrelated histories` because filter-repo rewrote the shared early commits and changed their SHAs. What worked: for each original commit (from the archived branch tip: `git log --reverse --format=... origin/main..<tag>`, dedupe by SHA, skip your own authors), run `git commit --allow-empty --author="Name <email>" --date=<original ISO date> -m "<subject>\n\nHistory record of <name>'s commit <sha10>... content ported file by file..."`. Verify `git diff --stat origin/main <branch>` is empty, merge the PR with a merge commit (not squash), and add CREDITS.md. Archive the old tips as pushed tags first, then reset or delete their branches with --force-with-lease against the archived SHA. Note the archive tags keep the sponsor data on the remote, so delete them later if that matters.
