Skip to content

Instantly share code, notes, and snippets.

@zlocate
Created August 9, 2020 20:15
Show Gist options
  • Save zlocate/3889da8cdeb658a31f17363a4afea472 to your computer and use it in GitHub Desktop.
Save zlocate/3889da8cdeb658a31f17363a4afea472 to your computer and use it in GitHub Desktop.
Extract and open in browser repository url (e.g for Github it's repo webpage)
#!/bin/bash
cd "$(pwd)";
SITE_URL=$(git config --get remote.origin.url)
if [ "$URL" ]; then
echo Repository URL: "$URL"
xdg-open "$URL"
else
echo "Git repository not found (or origin is empty)"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment