-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathdates in git
More file actions
23 lines (12 loc) · 728 Bytes
/
dates in git
File metadata and controls
23 lines (12 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Git has a very flexible date format.
You can specify a date both in a fixed (01/01/16) and relative format ("last week").
Git can handle every division of time between seconds and years, timezones and most date formats. It can even make a best guess if you give it something it doesn't recognise!
Date examples
To see the commits since the 1st Jan 2016:
$ git log --since="01/01/2016"
To compare the repository between two different dates:
$ git diff master@{"yesterday"}
master@{"2 weeks 2 days ago"}
To revert to an old version of a repository:
$ git revert master@{"last Tuesday"}
Note: these commands use the committer date not the author date. The committer date refers to the time the work was last applied.