Skip to content

Instantly share code, notes, and snippets.

@ykpythemind
Created December 30, 2021 02:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ykpythemind/3bc4692a1bc9a91ceb1b83d294376729 to your computer and use it in GitHub Desktop.
Save ykpythemind/3bc4692a1bc9a91ceb1b83d294376729 to your computer and use it in GitHub Desktop.
push and create pull request
```
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