Skip to content

Instantly share code, notes, and snippets.

@mlocher
Created June 24, 2015 10:15
Show Gist options
  • Save mlocher/a589be8fe4141ae42d2e to your computer and use it in GitHub Desktop.
Save mlocher/a589be8fe4141ae42d2e to your computer and use it in GitHub Desktop.
Get GitHub repository name from a remote URL
#!/bin/bash
git config --get remote.origin.url | sed -re 's|^https?://github.com/(.*).git$|\1|g'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment