Created
May 16, 2018 16:42
-
-
Save wreulicke/c24e1ac86293975af4b7ecb45f49a917 to your computer and use it in GitHub Desktop.
gitのoriginのGitHubのURLからorganizationとrepository取り出す奴
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
#!/bin/bash | |
TEMP=$(git remote get-url origin | sed 's/[email protected]://' | sed s/.git// | sed 's/\// /') | |
ORG=$(echo $TEMP | sed -e 's/\(.*\) \(.*\)/\1/') | |
REPO=$(echo $TEMP | sed -e 's/\(.*\) \(.*\)/\2/') | |
echo $ORG | |
echo $REPO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment