-
-
Save nafeger/701464 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Prompt | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
export PS1="\[\033[31;38m\]\u@\h\[\033[00m\]:\[\033[31;38m\]\w\[\033[1;31m\]\$(parse_git_branch)\[\033[00m\] " | |
# 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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment