Skip to content

Instantly share code, notes, and snippets.

@vinnybad
Created June 3, 2016 20:49
Show Gist options
  • Save vinnybad/53892110a04324326f344b65774f8f1d to your computer and use it in GitHub Desktop.
Save vinnybad/53892110a04324326f344b65774f8f1d to your computer and use it in GitHub Desktop.
#
# This is my preferred .bash_profile
#
# It has more context around git repositories, coloring, etc. Sections of this .bash_profile
# were certainly inspired by others' files (especially the git aliases).
#
export GITAWAREPROMPT=~/.bash/git-aware-prompt
source "${GITAWAREPROMPT}/main.sh"
# Example aliases
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# Git aliases
alias glog='git log '
alias gst='git status '
alias ga='git add '
alias gaa='git add .'
alias gbr='git branch '
alias gbrl='git branch -a'
alias gcm='git commit -v'
alias gcma='git commit -av'
alias gph='git push'
alias gpl='git pull'
alias gplr='git pull --rebase'
alias gbs='git bisect start'
alias gbb='git bisect bad'
alias gbg='git bisect bad'
alias gdf='git diff'
alias go='git checkout '
alias gfs='git flow feature start'
alias gff='git flow feature finish'
alias gfp='git flow feature publish'
alias fgo='git flow feature checkout '
alias gk='gitk --all&'
alias gx='gitx --all'
alias gl='git l'
alias gla='git la'
alias glr='git lr'
alias glra='git lra'
alias gh='git h'
alias grt='git reset'
alias grth='git reset --hard'
alias grthh='git reset --hard HEAD'
alias gr='git r'
alias grc='git rc'
alias grs='git rs'
alias gra='git ra'
alias gm='git merge --no-ff'
alias gsth='git stash'
alias gsthp='git stash pop'
alias gsthd='git stash drop'
alias gsths='git stash show'
alias gexport='git archive --format zip --output'
alias gcount='git shortlog -sn'
alias gcp='git cherry-pick'
alias gco='git checkout'
alias gdel='git branch -D'
alias gpnb='gph 2>&1 > /dev/null | grep git | sh'
alias gybn='git reflog HEAD | grep 'checkout:' | head -1 | rev | cut -d" " -f1 | rev | copy'
alias got='git '
alias get='git '
alias gup='git push -u origin `git rev-parse --abbrev-ref HEAD`'
#ls Colors
export CLICOLOR=1
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
# git-aware prompt
export PS1="\u@\h \w \[$txtgrn\]\$git_branch\[$txtred\]\$git_dirty\[$txtrst\]\$ "
# Stop sending cocoapods stats
# COCOAPODS_DISABLE_STATS=true
# git bash completion
source ~/.bash/git-completion.bash
#
# iOS Dev
#
alias yy="rm -rf Pods *.xcworkspace; pod install; open SomeWorkspace.xcworkspace"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment