Skip to content

Instantly share code, notes, and snippets.

@phatblat
Created April 22, 2013 02:21
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phatblat/5432046 to your computer and use it in GitHub Desktop.
Save phatblat/5432046 to your computer and use it in GitHub Desktop.
Bash script to extract the repo name out of a URL
#!/bin/bash
repo_url=git@github.com:phatblat/dotfiles.git
repo=${repo_url##*/}
echo ${repo%%.*}
@Xantios
Copy link

Xantios commented Jul 13, 2018

Thanks ! :) Just what I needed 👍

@demmorou
Copy link

Nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment