Created
October 9, 2017 12:48
-
-
Save belaz/748409abcf5dc41a393ee51c5acbf5ff to your computer and use it in GitHub Desktop.
git alias fix pull request
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
# git | |
fixpr = "!f(){ \ | |
git stash;\ | |
git checkout master;\ | |
git pull;\ | |
git branch -D \"$1-fixed\";\ | |
git push --delete origin \"$1-fixed\";\ | |
git branch -D \"$1-pre-fix\";\ | |
git checkout $1;\ | |
git checkout -b \"$1-pre-fix\"; \ | |
git checkout master;\ | |
git branch -D develop;\ | |
git checkout develop;\ | |
git pull origin develop;\ | |
git checkout -b \"$1-fixed\";\ | |
git checkout -m $( git log -n 1 \"$1-pre-fix\" --pretty=format:\"%H\") $(git diff develop \"$1-pre-fix\" --name-only | paste -sd \" \" -); \ | |
}; f" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment