Skip to content

Instantly share code, notes, and snippets.

@JamieMason
Created July 20, 2012 18:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JamieMason/3152574 to your computer and use it in GitHub Desktop.
Save JamieMason/3152574 to your computer and use it in GitHub Desktop.
.bash_profile
# PATH ADDITIONS
export PATH="~/bin:$PATH"
# GIT CREDENTIALS
GIT_AUTHOR_NAME="You"
GIT_AUTHOR_EMAIL="you@yours.com"
GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"
GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"
git config --global user.name "$GIT_AUTHOR_NAME"
git config --global user.email "$GIT_AUTHOR_EMAIL"
# SUBLIME TEXT
export EDITOR='subl -w'
git config --global core.editor "subl -w"
# TERMINAL SHORTCUTS
alias jenkins="java -jar /Applications/Jenkins/jenkins.war && open http://localhost:8080"
alias jstd="java -jar ~/bin/JsTestDriver-1.3.4.b.jar --port 4224 --tests all"
alias restart_apache="sudo apachectl restart"
alias rm_ds_store="find ./ -type f | grep .DS_Store | xargs rm" # rm .DS_Store files recursively
# GIT
alias clone="git clone" # clone git repo
alias commit_authors="git shortlog | grep -E '^[^ ]'"
alias commit_last="git cat-file commit HEAD"
alias commit_total="git shortlog | grep -E '^[ ]+\w+' | wc -l"
alias gaa="git add -A"
alias gap="git add --patch"
alias gb="git branch " # branch current repo to branch name
alias gb="git branch"
alias gba="git branch -a --color" # all branches (current highlighted)
alias gbc="git checkout -b" # create branch
alias gca="git commit --amend"
alias gch="git cherry -v"
alias gclear="find . -name .git -print0 | xargs -0 rm -rf" # removes all .git folders from directory recursively
alias gcm="git commit -m"
alias gco="git checkout"
alias gcod="git checkout develop"
alias gcom="git checkout master"
alias gcp="git cherry-pick"
alias gcv="git commit -v"
alias gdiff="git diff --word-diff " # shows a diff between the two branches specified
alias gf="git fetch"
alias gfs="gf && gs"
alias gi="git init" # init empty git repo
alias gl="git log --graph --pretty=format:'%C(yellow)%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative --oneline --decorate"
alias glo="git log --pretty=oneline --abbrev-commit --decorate"
alias gmd="git merge develop"
alias gmf="git merge --ff-only"
alias gmm="git merge master"
alias gmm="git merge"
alias gplo=="git pull origin"
alias gplod="git pull origin develop"
alias gplom="git pull origin master"
alias gpp="git pull --rebase && git push"
alias gpso="git push origin"
alias gpsod="git push origin develop"
alias gpsom="git push origin master"
alias grh="git reset --hard"
alias gs="git status -sb"
alias gweb="git instaweb --httpd=webrick" # launch web interface for git repos
alias gwp="git whatchanged -p"
alias merge="git merge --no-ff " # merges the supplied branch into the current branch
alias pullr="git pull --rebase" # update local repo --rebase style
alias rebase="git rebase -i " # will merge changes from specified branch into current branch
alias stash="git stash " # stash the current changes away with supplied message
alias tag="git tag -a" # tag current repo to tag name
alias tags="git tag -l" # lists current tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment