Created
November 7, 2020 04:33
-
-
Save seisvelas/bd38e65959b4859dc326843b960eb7f5 to your computer and use it in GitHub Desktop.
Easier git pushes
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 | |
git push 2> /dev/null | |
if [ $? -eq 128 ] | |
then | |
$(git push 2>&1 \ | |
| grep 'git push') 2>&1 \ | |
| grep https \ | |
| awk '{ print $2 }' \ | |
| xargs firefox | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I spend a lot of time repeating this series of tasks:
Because copying/pasting the --set-upstream stuff is quicker than typing out the branch names.
I made this script to automate that process. Rename this script to 'push', chmod +x push, and move it to $HOME/.local/bin and then in any git branch you can conveniently push by just typing 'push' and let the magic happen.
So this is how I cope with being such a git noob.