Created
December 30, 2021 02:59
-
-
Save ykpythemind/3bc4692a1bc9a91ceb1b83d294376729 to your computer and use it in GitHub Desktop.
push and create pull request
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
``` | |
function push() { | |
local result st a | |
result=$(git push 2>&1 -u origin `git branch | grep \* | cut -d ' ' -f2`) | |
st=$? | |
if [ $st = 0 ]; then | |
a=$(echo "$result" | grep 'Create a pull request for') | |
if [ -n "$a" ]; then | |
git brws --pr | |
fi | |
else | |
echo 'git push failed.' | |
fi | |
echo $result | |
return $st | |
} | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment