Skip to content

Instantly share code, notes, and snippets.

@belaz
Created October 9, 2017 12:48
Show Gist options
  • Save belaz/748409abcf5dc41a393ee51c5acbf5ff to your computer and use it in GitHub Desktop.
Save belaz/748409abcf5dc41a393ee51c5acbf5ff to your computer and use it in GitHub Desktop.
git alias fix pull request
# 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