Skip to content

Instantly share code, notes, and snippets.

@curder
Last active March 12, 2019 07:36
Show Gist options
  • Save curder/e848cbab5ea4df06cc2d891a888f7eec to your computer and use it in GitHub Desktop.
Save curder/e848cbab5ea4df06cc2d891a888f7eec to your computer and use it in GitHub Desktop.
Mac Developer Alias

put below code into your ~/.zshrc || ~/.bashrc || /etc/profile

if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
  unset i
fi

then save below file alias.sh into /etc/profile.d/

and reload this config use source ~/.zshrc or source ~/.bashrc or source /etc/profile

# Directories
alias c='clear'
alias ll='ls -FGlAhp'
alias ..="cd ../"
alias ...="cd ../../"
alias ....="cd ../../../"
alias .....="cd ../../../../"
# Git Alias
alias g='git'
alias ga='git add '
alias gb='git branch'
alias gaa='git add --all'
alias gst="git status"
alias glog="git log --oneline --decorate --graph"
alias gaa='git add --all'
alias gc='git commit -v'
alias gl='git pull'
alias gp='git push '
alias gcb='git checkout -b'
alias gcd='git checkout develop'
alias gcm='git checkout master'
alias gmd='git merge develop'
alias nah='git reset --hard;git clean -df'
alias wip='git add . && git commit -m '\''WIP'\'
alias wipa='git add . && git commit --amend -m '\''WIP'\'
alias gm='git merge'
alias gmd='git merge develop'
alias grbm='git rebase master'
alias glog='git log --oneline --decorate --graph'
alias gll="git log --graph --abbrev-commit --decorate --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(dim white) - %an%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n %C(white)%s%C(reset)'"
# Laravel Artisan Alias
alias art='php artisan '
alias tinker='php artisan tinker'
# PHPUnit Test.
alias p="vendor/bin/phpunit "
alias pf="vendor/bin/phpunit --filter "
# Sort Dir
alias sdu="du -hs * | sort -h "
# Lsof
alias lsof="sudo lsof -nP -iTCP -sTCP:LISTEN | grep "
# SourceTree Alias
alias stree='open -a SourceTree '
# Valet Alias
alias restartValet="sh -x /opt/sh/restartValet.sh"
alias stopValet="sh -x /opt/sh/stopValet.sh"
# MySQL Alias
alias mmysql="/Applications/MAMP/Library/bin/mysql"
alias lmysql="/usr/local/opt/[email protected]/bin/mysql"
# Homestead
function hs() {
( cd ~/Homestead && vagrant $* )
}
# Others System Alias
alias zshconfig="vim ~/.zshrc"
alias cat="ccat" # https://github.com/jingweno/ccat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment