File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ and pairing with smart people at Hashrocket.
99
1010For a steady stream of TILs, [ sign up for my newsletter] ( https://tinyletter.com/jbranchaud ) .
1111
12- _ 890 TILs and counting..._
12+ _ 891 TILs and counting..._
1313
1414---
1515
@@ -248,6 +248,7 @@ _890 TILs and counting..._
248248- [ Untrack A Directory Of Files Without Deleting] ( git/untrack-a-directory-of-files-without-deleting.md )
249249- [ Untrack A File Without Deleting It] ( git/untrack-a-file-without-deleting-it.md )
250250- [ Update The URL Of A Remote] ( git/update-the-url-of-a-remote.md )
251+ - [ Using Commands With A Relative Date Format] ( git/using-commands-with-a-relative-date-format.md )
251252- [ Verbose Commit Message] ( git/verbose-commit-message.md )
252253- [ Viewing A File On Another Branch] ( git/viewing-a-file-on-another-branch.md )
253254- [ What Changed?] ( git/what-changed.md )
Original file line number Diff line number Diff line change 1+ # Using Commands With A Relative Date Format
2+
3+ If you want to know what changed on a branch _ since_ last week, you can more or
4+ less ask just like that:
5+
6+ ``` bash
7+ $ git log --since=" 1 week ago"
8+ ```
9+
10+ Or, what has happened since yesterday:
11+
12+ ``` bash
13+ $ git log --after=" yesterday"
14+ ```
15+
16+ The ` --since ` /` --after ` flags, and their counterparts ` --until ` /` --before ` ,
17+ accept a variety of date formats including _ relative dates_ .
18+
19+ Relative dates can be used with other commands and even as a ref modifier. For
20+ instance, this is a way of comparing ` develop ` from a week ago with ` develop `
21+ from two weeks ago:
22+
23+ ``` bash
24+ $ git diff develop@{" 1 week ago" } develop@{" 2 weeks ago" }
25+ ```
26+
27+ [ source] ( https://alexpeattie.com/blog/working-with-dates-in-git )
You can’t perform that action at this time.
0 commit comments