Big-Bang Repo Move
Move all files from an old repo to a new repo, intentionally losing commit history. Purge private/client info from the new repo before pushing. The old repo is left untouched.
Arguments
$0— Path to the old (source) repo$1— Path to the new (destination) repo
If arguments are not provided, ask the user for both paths.
Workflow
Step 1: Validate Repos
- Confirm
$0exists and is a git repo - Confirm
$1exists. If it is not a git repo yet, rungit initand create an initial empty commit:git commit --allow-empty -m "Initial commit" - Confirm
$1has a remote configured (git remote -v). If not, ask the user for the remote URL and add it.
Step 2: Copy Files
- Copy all files from
$0to$1, excluding.git/directory
- Use
rsync -av --exclude='.git' <old>/ <new>/for reliable copy
- Verify files were copied correctly
Step 3: Purge Private Info
Run /purge-private-info on the NEW repo ($1) to scan and clean private/client information.
Step 4: Commit and Push
- Run
/commitson the new repo to commit all files - Push to the remote:
git push -u origin main(or the appropriate branch name)
Step 5: Update Old Repo Remote (Optional)
Ask the user if they want to update the old repo's remote to point to the new repo. If yes:
- Get the new remote URL from
$1:git -C $1 remote get-url origin - Update the old repo's remote:
git -C $0 remote set-url origin <new-url>
Step 6: Summary
Report what was done:
- Files copied from old to new repo
- Private info purged (summary from purge step)
- New repo committed and pushed
- Whether old repo remote was updated
Important Notes
- Never modify the old repo's files or history — only optionally update its remote URL
- All commit history is intentionally lost — this is a fresh start
- The old repo remains as-is for reference
- Always confirm with the user before pushing
