Skip to content

Instantly share code, notes, and snippets.

@cxkoda
Last active April 20, 2022 12:40
Show Gist options
  • Save cxkoda/d071325fcb3a04cd8a4b55e6c28c4692 to your computer and use it in GitHub Desktop.
Save cxkoda/d071325fcb3a04cd8a4b55e6c28c4692 to your computer and use it in GitHub Desktop.
Phony PRs to review entire codebase

Phony PRs to review entire codebase

This creates a new repository root (empty), clones all commits and rebases them to the new root (review). The diff between review and empty therefor includes the whole codebase as addition.

git switch --orphan empty
git commit --allow-empty -m 'empty'
git checkout main
git checkout -b review
git rebase empty
git push origin empty review
git checkout main

Navigate to the repos PRs and create a new one for empty <- review.

If you want to add new commits from main to the review

git checkout main
git checkout -b tmp
git rebase review
git checkout review
git reset tmp --hard
git branch -D tmp
git push origin review
git checkout main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment