Created
January 27, 2012 10:51
-
-
Save usefulthink/1688258 to your computer and use it in GitHub Desktop.
dotfile-snippets - some pretty useful things to have in your dotfiles
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
# compute the current git branch, if any | |
ps1_git_extra() { | |
local branch=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/') | |
if [ -z "$branch" ] ; then return ; fi | |
echo -n "[$branch]" | |
} | |
if [ "$color_prompt" = yes ]; then | |
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\[\033[33m\]$(ps1_git_extra)\[\033[00m\]\$ ' | |
else | |
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' | |
fi |
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
[alias] | |
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short | |
type = cat-file -t | |
dump = cat-file -p | |
sdiff = diff --staged | |
st = status | |
stat = status |
hmmm... ci ist üblicherweise ein shortcut für commit -a
, aber davon halte ich nicht soviel. Es gibt ja tab-completion, daher braucht man die ja gar nicht soo dringend.
den hist alias find ich spitze
ne ebenfalls nette alternative ist
git log --oneline --decorate --graph --all
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
noch ein paar .gitconfig standards:
br = branch
ci = commit
co = checkout