Changes between Initial Version and Version 1 of GitTricks


Ignore:
Timestamp:
Sep 23, 2010 2:13:15 PM (14 years ago)
Author:
mikeryan
Comment:

file history, check out old version

Legend:

Unmodified
Added
Removed
Modified
  • GitTricks

    v1 v1  
     1= History of an individual file =
     2Text mode
     3{{{
     4git log -p <filename>
     5}}}
     6
     7Graphically
     8{{{
     9gitk <filename>
     10}}}
     11
     12= Find revision by date =
     13This is kind of obtuse, and I really recommend {{{ git log }}} or {{{ gitk }}}. If you insist:
     14{{{
     15git rev-list -n 1 --before="2009-07-27 13:37" master
     16}}}
     17This finds one revision (-n 1) before a certain date. You can use this with {{{ git checkout }}} (see below).
     18
     19= Check out old version of a file =
     20Find the old revision by using {{{ git log }}} (see above).
     21{{{
     22git checkout <revision> <file>
     23}}}
     24
     25Reverting to the current version (HEAD):
     26{{{
     27git checkout HEAD <file>
     28}}}