Created
April 23, 2021 17:48
-
-
Save mangangreg/6006d2598f04d50a71b0b03b7f02592a to your computer and use it in GitHub Desktop.
Git push from specific user
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
# Usage `gpushu <username>` from inside of a repo, to push to git from user, will get prompted for password | |
function gpushu(){ | |
USERNAME=$1 | |
REPO=`git config --get remote.origin.url | awk -F 'com' '{print $2}' | cut -c 2-` | |
git push "https://$USERNAME@github.com/$REPO" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment