7jbwww
Last Updated: January 19, 2019
·
8.214K
· rbonvall

git today — Quickly see what you've done today

First, create this alias:

git config --global alias.today "log --since=midnight --author='Roberto Bonvallet' --oneline"

Of course, you have to replace my name with yours. Then, before leaving office for a well-deserved rest, you can reflect on what you've accomplished during your working day by issuing this simple command:

git today

23 Responses
Add your response

10685

Nice idea, you can avoid hard-coding your name like this:

git config --global alias.today '!git log --since=midnight --author="$(git config user.name)" --oneline'

Or if you just want to avoid typing it but still have it "fixed":

git config --global alias.today "log --since=midnight --author='$(git config user.name)' --oneline"
over 1 year ago ·
10737

Nice one.

over 1 year ago ·
10771

I love these short commands :)

over 1 year ago ·
10794

Nice one!

over 1 year ago ·
10865

I absolutely love this one! I just gave it a go myself to see if I can get my commits on all branches I did yesterday and the following one works like a charm:

git config --global alias.all-yesterday = !git log --graph --all --since="day.before.yesterday.midnight" --until=midnight --author=\"$(git config user.name)\" --oneline

$ git all-yesterday

Of course if you need only the currently active branch, get rid of the --all flag from the command.

over 1 year ago ·
10878

@heartcode the following seems also works:

--since="yesterday.midnight"
over 1 year ago ·
10900

That's what I thought @yevgenko, but for some reason it didn't give me anything yesterday. Now today both my version and yours return the same list of commits, so I'll just go for 'yesterday.midnight', as it makes more sense :) Thanks!

over 1 year ago ·
10969

Thanks for sharing!

over 1 year ago ·
10976

Nice idea

over 1 year ago ·
10989

Had some problems with @heartcode code (the = part) but modified this to:

git config --global alias.yesterday '!git log --graph --all --since="yesterday.midnight" --until="midnight" --author="$(git config user.name)" --oneline'

And it works perfectly. Thanks!

over 1 year ago ·
10990

+1 @kamilwysocki you're right. I just realised the extra '=' in mine, which shouldn't be there. Sorry for the confusion.

over 1 year ago ·
11335

What about "git tomorrow" ? :)

over 1 year ago ·
11925

Thanks

over 1 year ago ·
12229

I can't get this to work. I think it's erring because of the space in my name.

fatal: ambiguous argument 'Ideler': unknown revision or path not in the working tree.

Here's the alias in my .gitconfig:

today = !git log --since=midnight --author="$(git config user.name)" --oneline

And my Git user name:

$ git config user.name
Dennis Ideler
over 1 year ago ·
12803

@dideler the double quotes should be escaped. They're automatically escaped if use single quotes on the outside and double quotes inside. as in

$ git config --global alias.today '!git log --since=midnight --author="$(git config user.name)" --oneline'

over 1 year ago ·
12850

Thanks @yaw! I like to edit my aliases directly in .gitconfig and I tried putting single quotes around the whole thing but that didn't work, instead I escaped the double quotes with backslashes.

over 1 year ago ·
13541

Ha ha you guys are crazy!

over 1 year ago ·
15263

what does --oneline flag do? I can't google it or git config --help ?

Thanks! :)

over 1 year ago ·
15481

Great alias, thanks!

over 1 year ago ·
15800

This doesn't work for me. I'm using Git version 1.9.3 and --since says it takes a date. Any ideas?

over 1 year ago ·
18969

@hsuh It shortens every commit to be one line, instead of 8, which is default.

over 1 year ago ·
21672

@ianwalter: upgrade Git!

over 1 year ago ·
21676

Nice!

over 1 year ago ·