7jbwww
Last Updated: August 29, 2016
·
8.127K
· rbonvall
5986747b5b748191ff78064865e3a062

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
Say Thanks
Respond

23 Responses
Add your response

10685
Fde10bcf0813b2162545477be4e7470b

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
8af215e91fa605eec0b671d035388f68

Nice one.

over 1 year ago ·
10771
0d38ee92831618c24839dc002859c32f

I love these short commands :)

over 1 year ago ·
10794
091274f16cac5a60d378d0623bf6ae45

Nice one!

over 1 year ago ·
10865
Author

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
973ad379dbe22157734c3ac3c68ee00f

@heartcode the following seems also works:

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

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
Image

Nice idea

over 1 year ago ·
10989
Coderwall

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
Author

+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
D3a5ecc360da791277fc3807c51a0190

What about "git tomorrow" ? :)

over 1 year ago ·
11925
6d8c055e5e5e2fa67f470798b6f59907

Thanks

over 1 year ago ·
12229
12ecd2ec519dec0959f43f193eaca10c

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
1df75184e7ea8e155271683d98d2d67f

@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
12ecd2ec519dec0959f43f193eaca10c

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
20f9deff899c48207862212cdc1644de

Ha ha you guys are crazy!

over 1 year ago ·
15263
Suns

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

Thanks! :)

over 1 year ago ·
15481
3f09ab0c840a4ec7e504ea9805c6c0b9

Great alias, thanks!

over 1 year ago ·
15800
C4a7e952 d73f 4bde a7ad 2fbb2e6594b4

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
None

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

over 1 year ago ·
21672
70d9b050bfe39350c234d710fadfcd39

@ianwalter: upgrade Git!

over 1 year ago ·
21676
C4a7e952 d73f 4bde a7ad 2fbb2e6594b4

Nice!

over 1 year ago ·