Skip to content

Instantly share code, notes, and snippets.

@chrisdroukas
Created July 26, 2013 14:24
Show Gist options
  • Select an option

  • Save chrisdroukas/6089254 to your computer and use it in GitHub Desktop.

Select an option

Save chrisdroukas/6089254 to your computer and use it in GitHub Desktop.
Want to see what a designer's shit bash profile looks like? Look no further.
# Git completion
# https://github.com/git/git/tree/master/contrib/completion
source ~/.git-completion.sh
source ~/.git-prompt.sh
# Aliases and functions
alias ls='ls -1'
cd() {
builtin cd "$@" && ls;
}
function gh() {
giturl=$(git config --get remote.origin.url)
if [ "$giturl" == "" ]
then
echo "Not a git repository or no remote.origin.url set"
return;
fi
giturl=${giturl/git\@github\.com\:/https://github.com/}
giturl=${giturl/\.git/\/tree/}
branch="$(git symbolic-ref HEAD 2>/dev/null)" ||
branch="(unnamed branch)" # detached HEAD
branch=${branch##refs/heads/}
giturl=$giturl$branch
open $giturl
}
# Make it look sexy
PS1='\[$(tput bold)\]\u \W$(__git_ps1 " (%s)") \[$(tput setaf 4)\]▹ \[$(tput sgr0)\]'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment