Skip to content

Instantly share code, notes, and snippets.

View harryge00's full-sized avatar

Haoyuan Ge harryge00

  • Ant Financial
  • Hangzhou
View GitHub Profile
@harryge00
harryge00 / .bash_profile
Last active September 29, 2019 17:05 — forked from chrisberkhout/.bash_profile
Git aliases taken from oh-my-zsh's git plugin and translated to bash
# git aliases - taken from oh-my-zsh's git plugin and translated to bash
# https://github.com/robbyrussell/oh-my-zsh/wiki/Cheatsheet#helpful-aliases-for-common-git-tasks
# https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/git/git.plugin.zsh
function git_current_branch() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || \
ref=$(git rev-parse --short HEAD 2> /dev/null) || return
echo ${ref#refs/heads/}
}
function git_current_repository() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || \