Skip to content

Instantly share code, notes, and snippets.

View larry-ahn's full-sized avatar

larry larry-ahn

View GitHub Profile

Keybase proof

I hereby claim:

  • I am larry-actwo on github.
  • I am larry_peertec (https://keybase.io/larry_peertec) on keybase.
  • I have a public key ASCXPS3Nd-gtaKGJqQjgO7RXaMvvXJK8uoTS_nnbgvJ-0go

To claim this, I am signing this object:

@larry-ahn
larry-ahn / git_branch.sh
Created September 14, 2018 01:24 — forked from dciccale/git_branch.sh
Bash script to get the current git branch and last commit
#!/usr/bin/env bash
# checks if branch has something pending
function parse_git_dirty() {
git diff --quiet --ignore-submodules HEAD 2>/dev/null; [ $? -eq 1 ] && echo "*"
}
# gets the current git branch
function parse_git_branch() {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/"