Skip to content

Instantly share code, notes, and snippets.

@peteraritchie
Forked from azu/README.md
Last active March 21, 2019 14:07
Show Gist options
  • Save peteraritchie/02de21b0f78870ae4b0ef88c49d6d5fd to your computer and use it in GitHub Desktop.
Save peteraritchie/02de21b0f78870ae4b0ef88c49d6d5fd to your computer and use it in GitHub Desktop.
@REM #!/bin/bash
for /F "skip=1 usebackq delims=" %%a in (`git rev-parse --abbref-ref HEAD`) do (
set currentBranchName=%%a
)
@REM review branch
git checkout --orphan review
@REM remove under the git
for /f %a in ('git ls-files') do git rm --cached %a
@REM remove files
git clean -fxd
@REM create start point
git commit --allow-empty -m "Start of the review"
@REM create empty branch
git branch empty
@REM merge review point
@REM merge with prev branch(= probably master)
git merge "%currentBranchName%"
@REM push to origin
git push origin review
git push origin empty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment