Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

lukashillebrand commented Jun 6, 2011

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

@tfnico

This comment has been minimized.

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

This comment has been minimized.

Copy link

joecabezas commented Mar 15, 2012

whre can i ge this files?

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

@joecabezas

This comment has been minimized.

Copy link

joecabezas commented Mar 15, 2012

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

@lukashillebrand

This comment has been minimized.

Copy link

lukashillebrand commented Apr 3, 2012

@tfnico - thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.