Skip to content

Instantly share code, notes, and snippets.

@wjurkowlaniec
Created October 3, 2022 23:34
Show Gist options
  • Save wjurkowlaniec/ba584d1f0314485cd49eeceaa1beb719 to your computer and use it in GitHub Desktop.
Save wjurkowlaniec/ba584d1f0314485cd49eeceaa1beb719 to your computer and use it in GitHub Desktop.
  1. Make a fork of the project to review, and from then on use that fork for the reviews
  2. Create an empty branch with 'git checkout --orphan', for example git checkout --orphan review-1-target
  3. Run git status and note that all files are staged. Remove all files by unstaging them first with git reset . and, after, cleanning them with git clean -df.
  4. On the empty branch, create an empty commit with git commit --allow-empty -m 'Empty commit'
  5. Push the empty branch to our fork, git push -u origin review-1-target
  6. Now let’s go to the branch we want to review (say master), and create a new branch from it: git checkout -b review-1.
  7. We then want to rebase from our empty/target branch. Make sure to place the empty commit as the first commit on the branch, git rebase -i review-1-target
  8. Push the branch to the fork, git push -u origin review-1

Taken from https://thib.me/recipe-code-reviews-for-existing-code-with-github

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment