Last active
January 31, 2023 16:39
-
-
Save tadd/711a1f04cd89e488fb08ef562e045f43 to your computer and use it in GitHub Desktop.
Generate shortcut urls for .gitconfig
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
# Usage: sh gen-git-pushj-instead-of.sh github.com-name [gitlab.com-name] >>~/.gitconfig | |
# Then: | |
# git clone gist:711a1f04cd89e488fb08ef562e045f43 # or | |
# git clone gh:ruby/ruby | |
_url() | |
{ | |
printf "[url \"git@$2:${3:+$3/}\"]\n\tinsteadOf = $1:\n" | |
} | |
gh=github.com | |
gl=gitlab.com | |
usergh=$1 | |
usergl=${2:-$1} | |
_url gh $gh | |
_url gh-me $gh $usergh | |
_url gl $gl | |
_url gl-me $gl $usergl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment