Skip to content

Instantly share code, notes, and snippets.

@capotej
Created May 30, 2019 17:25
Show Gist options
  • Save capotej/824355723d4caf65e0d4c315ea46d660 to your computer and use it in GitHub Desktop.
Save capotej/824355723d4caf65e0d4c315ea46d660 to your computer and use it in GitHub Desktop.
git shell funcs/aliases
alias co="git checkout "
alias commit="git commit "
alias status="git status "
alias merge="git merge "
alias stash="git stash "
alias fuckit="git reset --hard"
function pushit() {
git push origin $(raw_git_branch)
}
function gca() {
git commit -a -m "$*"
}
function pullit() {
git pull origin $(raw_git_branch)
}
function raw_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
}
function bdd() {
git for-each-ref --sort=-committerdate refs/heads/ --format='%(committerdate) %(refname:short)' | tac | tail
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment