Created
June 2, 2020 11:27
-
-
Save mike623/24f44dbc390762c13e27e1ce60db7698 to your computer and use it in GitHub Desktop.
fork on current commit and reset move back old branch
This file contains 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
#!/bin/bash | |
branch_name=$(git rev-parse --symbolic-full-name --abbrev-ref HEAD); | |
echo "create new branch and reset prev of $branch_name"; | |
git checkout -b $1 | |
git checkout $branch_name | |
# reset pervious version | |
git reset --hard HEAD~1 | |
git checkout $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment