Skip to content

Instantly share code, notes, and snippets.

@wreulicke
Created May 16, 2018 16:42
Show Gist options
  • Save wreulicke/c24e1ac86293975af4b7ecb45f49a917 to your computer and use it in GitHub Desktop.
Save wreulicke/c24e1ac86293975af4b7ecb45f49a917 to your computer and use it in GitHub Desktop.
gitのoriginのGitHubのURLからorganizationとrepository取り出す奴
#!/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