Skip to content

Instantly share code, notes, and snippets.

@zaim
Created June 4, 2011 15:00
Show Gist options
  • Save zaim/1007958 to your computer and use it in GitHub Desktop.
Save zaim/1007958 to your computer and use it in GitHub Desktop.
My .bash_aliases
function p {
if [ -z "$1" ]; then
echo "Syntax: p NAME"
echo " cd to first project matching NAME"
else
match=$(find ~/projects -type d -name "$1" | line)
if [ -n "$match" ]; then
cd $match
fi
fi
}
function cdp {
if [ -f ~/.project ]; then
cd $(cat ~/.project)
else
echo "No .project file"
fi
}
alias ll='ls -lh'
alias lo='ls -oh'
alias la='ls -A --group-directories-first'
alias l='ls -CF'
alias projs='cd ~/projects; ls -d */'
alias aliases='gedit ~/.bash_aliases; reload'
alias reload='. ~/.bash_aliases'
alias ..='cd ..'
alias cd..='cd ..'
alias gs='git status'
alias gb='git branch'
alias gca='git commit -a'
alias gcm='git commit -m'
alias gl='git pull'
alias gp='git push'
alias gpom='git push origin master'
alias gd='git diff'
alias gco='git checkout'
alias pull='git pull origin master'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment