Skip to content

Instantly share code, notes, and snippets.

@marek-saji
Created April 17, 2014 11:40
Show Gist options
  • Save marek-saji/10976493 to your computer and use it in GitHub Desktop.
Save marek-saji/10976493 to your computer and use it in GitHub Desktop.
git aliases for keeping worklog in .git/worklog
[alias]
# Worklog. Separate repository kept in .git/worklog
# Initialize (bare) repository in .git/worklog
workloginit = !"\
set -e ;\
mkdir .git/worklog;\
cd .git/worklog;\
git init --bare;\
echo '*' > .gitignore;\
git --work-tree=. add -f .gitignore;\
git --work-tree=. commit -m 'Ignore *';\
# Ignore parameters"
# Show worklog
worklog = !"git --git-dir=.git/worklog --work-tree=.git/worklog log"
# Add new entry (with tomorrow's date by default)
worklogadd = !"\
DATE=\"$( date -d \"${1:-tomorrow}\" )\" );\
shift;\
git --git-dir=.git/worklog --work-tree=.git/worklog commit --allow-empty --date=\"${DATE}\""
# Edit last entry
worklogedit = !"git --git-dir=.git/worklog --work-tree=.git/worklog commit --allow-empty --amend"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment