Skip to content

Instantly share code, notes, and snippets.

@Maciek416
Created October 13, 2011 18:38
Show Gist options
  • Save Maciek416/1285070 to your computer and use it in GitHub Desktop.
Save Maciek416/1285070 to your computer and use it in GitHub Desktop.
alias ll='ls -la'
alias git-up='git fetch; git rebase origin master'
alias gs='git status -sb'
# Git
alias ungit="find . -name '.git' -exec rm -rf {} \;"
alias gb='git branch'
alias gba='git branch -a'
alias gmm='git merge master'
alias gc='git commit -v'
alias gca='git commit -v -a'
alias gci='git commit -v -m'
alias gaa='git add .'
alias ga='git add'
# Commit pending changes and quote all args as message
function gg() {
git commit -v -a -m "$*"
}
alias gco='git checkout'
alias gd='git diff'
alias gdm='git diff master'
alias gl='git pull'
alias gnp="git-notpushed"
alias gp='git push'
alias gst='git status -sb'
alias gt='git status -sb'
alias g='git status -sb'
alias eg='mate .git/config'
alias glg='git log --graph --pretty=format:"%an: %s - %Cred%h%Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset" --abbrev-commit --date=relative'
# Git clone from GitHub
function gch() {
git clone git://github.com/$USER/$1.git
}
# Git export
function gex() {
git checkout-index -a --prefix=$1/
}
# Setup a tracking branch from [remote] [branch_name]
function gbt() {
git branch --track $2 $1/$2 && git checkout $2
}
# Quickly clobber a file and checkout
function grf() {
rm $1
git checkout $1
}
# Call from inside an initialized Git repo, with the name of the repo.
function new-git() {
ssh [email protected] "mkdir $1.git && cd $1.git && git --bare init"
git remote add origin [email protected]:$1.git
git push origin master
git config branch.master.remote origin
git config branch.master.merge refs/heads/master
git config push.default current
}
# Git SVN
alias gsl='git spull'
alias gsp='git spush'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment