From 35c06023581222663bacdbbbfcf2cc1362287082 Mon Sep 17 00:00:00 2001 From: Nick Nisi Date: Tue, 8 Apr 2014 16:41:11 -0500 Subject: [PATCH] [git] add alias to get current branch name This is useful for scripting --- git/gitconfig.symlink | 2 ++ 1 file changed, 2 insertions(+) diff --git a/git/gitconfig.symlink b/git/gitconfig.symlink index 47eb8e3..ba5ab25 100644 --- a/git/gitconfig.symlink +++ b/git/gitconfig.symlink @@ -33,6 +33,8 @@ # show what I did today day = "!sh -c 'git log --reverse --no-merges --branches=* --date=local --after=\"yesterday 11:59PM\" --author=\"`git config --get user.name`\"'" churn = "!f() { git log --all -M -C --name-only --format='format:' \"$@\" | sort | grep -v '^$' | uniq -c | sort | awk 'BEGIN {print \"count\tfile\"} {print $1 \"\t\" $2}' | sort -g; }; f" + # current branch + cbr = rev-parse --abbrev-ref HEAD # assume aliases assume = update-index --assume-unchanged