Skip to content

Instantly share code, notes, and snippets.

@cverbiest
Last active October 13, 2020 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cverbiest/58d45e8e93022cbc591684d8b1073d66 to your computer and use it in GitHub Desktop.
Save cverbiest/58d45e8e93022cbc591684d8b1073d66 to your computer and use it in GitHub Desktop.
git oneliners

Bitbucket oneliners

get project & repo slug from BitBucket remote

Parse the output of git remote using awk to determine project & repo slugs

git remote -v | awk '/(push)/{ print $2; split($2, ru, "/"); projectslug = ru[4]; reposlug = gensub(/\.git/, "", "g", ru[5]); print projectslug " " reposlug;}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment