I have a bunch of git aliases already set up in my .bash_profile that work correctly:
alias gst="git status"
alias gl="git pull"
alias gp="git push"
alias gd="git diff | mate"
alias gc="git commit -v"
alias gca="git commit -v -a"
alias gb="git branch"
alias gba="git branch -a"
I'm trying to add an alias for the following command, but keep running into an error:
git log --all --pretty=format:'%h %cd %s (%an)' --since='7 days ago'
What I'd like to do, is be able to type:
glog 'some amount of time'
So, being new at both aliases and git, I figured this would work:
alias glog="git log --all --pretty=format:'%h %cd %s (%an)' --since="
It throws the following error:
fatal: ambiguous argument '7 days ago': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
How can I correct my alias to make this work?
Thanks!
[EDIT]
I can make it work if I change the alias to:
alias glog="git log --all --pretty=format:'%h %cd %s (%an)'"
and then just type in:
glog --since='some amount of time'
but I'd really like to just type the amount of time, if possible.