Created
May 5, 2017 15:54
-
-
Save jstockdi/3910c91b6b34dfc13efe09ec3b32dd9f to your computer and use it in GitHub Desktop.
github-codebase-review
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BRANCH_NAME=$1 | |
## Checkout empty orphan | |
git checkout --orphan ${BRANCH_NAME}-empty | |
## Remove all files | |
git rm -r --cached * | |
## Clean all the files | |
git clean -fxd | |
# Verify all good | |
git log | |
##Create foo commit to create shared history | |
git commit --allow-empty -m "Start of the review" | |
## Create review branch from main | |
git checkout -b ${BRANCH_NAME}-review | |
## Merge in code to be reviewed | |
git merge master --allow-unrelated-histories --squash | |
## Commit squashed commit | |
git commit -m 'Squash commit!' | |
## Verify all good | |
git status | |
git log | |
## Push the branches | |
git push origin ${BRANCH_NAME}-empty | |
git push origin ${BRANCH_NAME}-review | |
## Perform code review @ github | |
## Delete the branches once you are done with the review | |
#git push origin :${BRANCH_NAME}-empty | |
#git push origin :${BRANCH_NAME}-review |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment