diff --git a/.aliases b/.aliases new file mode 100644 index 0000000..55f9a41 --- /dev/null +++ b/.aliases @@ -0,0 +1,26 @@ +alias ll='ls -lasG' + +# Git shortcuts +alias g='git' +alias ga='git add' +alias gp='git push' +alias gpa='gp --all' +alias gu='git pull' +alias gl='git log' +alias gg='gl --decorate --oneline --graph --date-order --all' +alias gs='git status' +alias gst='gs' +alias gd='git diff' +alias gdc='gd --cached' +alias gm='git commit -m' +alias gma='git commit -am' +alias gb='git branch' +alias gba='git branch -a' +function gc() { git checkout "${@:-master}"; } # Checkout master by default +alias gco='gc' +alias gcb='gc -b' +alias gr='git remote' +alias grv='gr -v' +#alias gra='git remote add' +alias grr='git remote rm' +alias gcl='git clone' \ No newline at end of file diff --git a/.bash_profile b/.bash_profile index 549c608..e2c555c 100755 --- a/.bash_profile +++ b/.bash_profile @@ -1,179 +1,11 @@ -export PATH=$HOME/local/node/bin:$PATH -export LC_ALL=en_US.UTF-8 -export LANG=en_US.UTF-8 - -alias ll='ls -lasG' - -# Git shortcuts -alias g='git' -alias ga='git add' -alias gp='git push' -alias gpa='gp --all' -alias gu='git pull' -alias gl='git log' -alias gg='gl --decorate --oneline --graph --date-order --all' -alias gs='git status' -alias gst='gs' -alias gd='git diff' -alias gdc='gd --cached' -alias gm='git commit -m' -alias gma='git commit -am' -alias gb='git branch' -alias gba='git branch -a' -function gc() { git checkout "${@:-master}"; } # Checkout master by default -alias gco='gc' -alias gcb='gc -b' -alias gr='git remote' -alias grv='gr -v' -#alias gra='git remote add' -alias grr='git remote rm' -alias gcl='git clone' - -# add a github remote by github username -function gra() { - if (( "${#@}" != 1 )); then - echo "Usage: gra githubuser" - return 1; - fi - local repo=$(gr show -n origin | perl -ne '/Fetch URL: .*github\.com[:\/].*\/(.*)/ && print $1') - gr add "$1" "git://github.com/$1/$repo" -} - -# git log with per-commit cmd-clickable GitHub URLs (iTerm) -function gf() { - local remote="$(git remote -v | awk '/^origin.*\(push\)$/ {print $2}')" - [[ "$remote" ]] || return - local user_repo="$(echo "$remote" | perl -pe 's/.*://;s/\.git$//')" - git log $* --name-status --color | awk "$(cat <