Skip to content

Instantly share code, notes, and snippets.

@ralfebert
Created August 9, 2010 19:16
Show Gist options
  • Star 45 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
  • Save ralfebert/515937 to your computer and use it in GitHub Desktop.
Save ralfebert/515937 to your computer and use it in GitHub Desktop.
git settings
# Prompt (Debian)
source /usr/local/bin/git-completion.sh
# Prompt (OS X + homebrew)
source /usr/local/etc/bash_completion.d/git-completion.bash
PS1="\[\033[31;38m\]\w\[\033[1;31m\]\$(__git_ps1)\[\033[00m\] "
export GIT_PS1_SHOWDIRTYSTATE=1
# Editor
export GIT_EDITOR='nano -Y patch'
# Shortcuts
# Creates git repostitory with some reasonable default settings in current folder
function git_here() {
git init
git config color.ui auto
echo "log tmp db/*.sqlite3 nbproject/private bin .DS_Store" | tr " " "\n" > .gitignore
git add .gitignore
git commit -m "initial project setup"
}
alias d='git diff --word-diff $@'
alias s='d;git status -sb'
alias b='git branch -avv'
alias a='git add $@'
alias c='git commit -v $@'
alias ac='git add .;c $@'
alias lg='git lg'
git config --global alias.lg "log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr %an)%Creset' --abbrev-commit --date=relative"
git config --global alias.wipe '!git reset --hard;git clean -fd'
git config --global color.ui auto
git config --global core.editor "nano -Y patch"
@lukashillebrand
Copy link

What does this command "git config --global alias.wipe '!git reset --hard;git clean -fd'" exactly do?

@tfnico
Copy link

tfnico commented Mar 12, 2012

@lukashillebrand: Looks like an alias "git wipe" that does these two things:

  • git reset --hard (resets the index and the work tree to the contents in HEAD, aka "revert all")
  • git clean -fd (removes all untracked files and directories)

@joecabezas
Copy link

whre can i ge this files?

source /usr/local/etc/bash_completion.d/git-completion.bash

@joecabezas
Copy link

oh thank you!, can you add it to this gist as a comment?, very usefull :)

@lukashillebrand
Copy link

@tfnico - thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment