Created
April 17, 2014 11:40
-
-
Save marek-saji/10976493 to your computer and use it in GitHub Desktop.
git aliases for keeping worklog in .git/worklog
This file contains hidden or 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] | |
# 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