Skip to content

Instantly share code, notes, and snippets.

@skurovec
Forked from VasekPurchart/.bashrc
Created August 14, 2014 09:53
Show Gist options
  • Save skurovec/8a104f684b5b1f56fc75 to your computer and use it in GitHub Desktop.
Save skurovec/8a104f684b5b1f56fc75 to your computer and use it in GitHub Desktop.
# used by Git (commit messages, rebase, ...)
export EDITOR=vim
# GIT bash current branch
# by HABR (modified by Dundee)
export PSORIG="$PS1"
function GITBRANCH() {
BRANCH="$(git branch 2>/dev/null | grep '*' | cut -d" " -f2-)"
if [ -n "$BRANCH" ] ; then
export PS1=$PSORIG$(echo -en "\[\033[01;33m\]$BRANCH > \[\033[00m\]")
else
export PS1="$PSORIG"
fi
}
PROMPT_COMMAND="GITBRANCH"
[user]
name = Vasek Purchart
email = me@vasekpurchart.cz
[core]
# windows->true, linux-> input
autocrlf = input
safecrlf = false
# must be absolute path
excludesfile = /home/Vasek/.gitignore_global
[alias]
f = fetch
# updates your branch with upstream (if fast-forward is possible)
ff = !git merge --ff-only `git rev-parse --symbolic-full-name --abbrev-ref=strict HEAD@{u}`
fp = fetch --prune
st = status
cm = commit
cma = commit --amend
br = branch
co = checkout
cp = cherry-pick
df = diff
rb = rebase
rbi = rebase -i
rbc = rebase --continue
rh = reset --hard
su = submodule update
# graph for current branch
l = log --graph --decorate --pretty=oneline --abbrev-commit
# graph for all branches
ll = log --graph --decorate --pretty=oneline --abbrev-commit --all
# log for current branch showing diffs (-m is for showing mergecommits too)
ld = log -p -m
# log for current branch showing summary of changed files (-m is for showing mergecommits too)
ls = log --stat -m
# number of commits for each person
stats = shortlog -n -s --no-merges
# remove remote branch (remote must be named origin), usage: git rmb test
rmb = !sh -c 'git push origin :$1' -
# shows local > tracked remote
brt = for-each-ref --format=\"%(refname:short) > %(upstream:short)\" refs/heads
# get upstream tracked branch or error
brtracked = rev-parse --symbolic-full-name --abbrev-ref=strict HEAD@{u}
# commit all changes to a WIP commit
wip = !git add $(git rev-parse --show-toplevel) && git commit -m WIP
# special branches
release = push origin HEAD:release
selenium = push origin HEAD:selenium
test = push origin HEAD:test
[remote "origin"]
# git push -> push current HEAD into tracked remote branch
push = HEAD
[diff]
mnemonicprefix = true
[pull]
rebase = true
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = green
changed = yellow
untracked = cyan
lockfile
*.log
######################
# OS generated files #
######################
.DS_Store?
ehthumbs.db
Icon?
Thumbs.db
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment