I'm working through the gitimmersion and creating alias [plural]. Everything worked except my hist.
$ git config --global alias.hist log --pretty=format: '%h %ad | %s%d [%an]' --graph --date=short
this takes me to the .config page, but doesn't create an alias
I know the code works (the part that I am making an alias for) because when I run
$ git log --pretty=format: '%h %ad | %s%d [%an]' --graph --date=short
it does the task I want.
Any ideas for making the alias work
You need some "" there to get everything passed through properly:
git config --global alias.hist "log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short"
In addition, I think you have an extra space between format: and the format string in both of your examples.
you've missed off '--add' and git doesn't like the space between format: '%h (at least on my mac)
try:
$ git config --global --add alias.hist "log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With