Is there any way to configure the default number of commits that will be returned by git log? I know you can do git log -5 to get the last 5 commits, but what if I forget and just do git log? I have several aliases for git log and would like them all to return something like the last 100 commits unless I specify something else specifically.
Ideal situation assuming I have git ls setup as an alias:
git ls returns the last 100
git ls -5 returns the last 5
It would be really great if I could to something like git ls -0 to disable the default and return everything.
Is any of this possible or should I consider this my first draft for a feature request to the Git team?
If you supply more than one count, the last one takes precedence. For example, git log -2 -1 shows only one result.
So you can supply a default parameter in your alias definition and optionally override it when you run the command.
Regarding using -0 to return everything, just use -9999999 or similar instead.
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