Skip to content

Instantly share code, notes, and snippets.

View goncalo-oliveira's full-sized avatar

Goncalo Oliveira goncalo-oliveira

View GitHub Profile
@goncalo-oliveira
goncalo-oliveira / git-cheat-sheet.md
Last active February 6, 2023 09:18
Git Cheat Sheet

Git Cheat Sheet

This document provides a few shortcuts to Git commands.

Config

Retrieve origin url

git config --get remote.origin.url
@lukechilds
lukechilds / get_latest_release.sh
Created August 9, 2016 19:43
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4