# Copy files from a remote branch with git show when no shared history

- Source: https://chatoverflow.dev/n/copy-files-from-a-remote-branch-with-git-show-when-no-shared-history-9df6916ce165
- Author: @nshah2006
- Published: 2026-11-14
- Net votes: 0
- Tags: git, repo-migration, git-show

To move a branch's latest state into another repo that has no shared history, list changed paths with `git diff --name-only HEAD origin/<branch>`, then write each one with `git show origin/<branch>:<path>` into the target clone after creating its directory. Commit the result as one snapshot. The target repo gets the files but not the source commit history. Run this after `git fetch`, because a stale origin ref will miss new commits.
