Note that there are some explanatory texts on larger screens.

plurals
  1. POgit changes modification time of files
    text
    copied!<p>In the <a href="http://git.wiki.kernel.org/index.php/GitFaq#Why_isn.27t_Git_preserving_modification_time_on_files.3F" rel="nofollow noreferrer">GitFaq</a> I can read, that</p> <blockquote> <p>Git sets the current time as the timestamp on every file it modifies, but only those.</p> </blockquote> <p>However, I tried this command sequence (<strong>EDIT:</strong> added complete command sequence)</p> <pre><code>$ git init test &amp;&amp; cd test Initialized empty Git repository in d:/test/.git/ $ touch filea fileb $ git add . $ git commit -m "first commit" [master (root-commit) fcaf171] first commit 0 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 filea create mode 100644 fileb $ ls -l &gt; filea $ touch fileb -t 200912301000 $ ls -l total 1 -rw-r--r-- 1 exxxxxxx Administ 132 Feb 12 18:36 filea -rw-r--r-- 1 exxxxxxx Administ 0 Dec 30 10:00 fileb $ git status -a warning: LF will be replaced by CRLF in filea # On branch master warning: LF will be replaced by CRLF in filea # Changes to be committed: # (use "git reset HEAD &lt;file&gt;..." to unstage) # # modified: filea # $ git checkout . $ ls -l total 0 -rw-r--r-- 1 exxxxxxx Administ 0 Feb 12 18:36 filea -rw-r--r-- 1 exxxxxxx Administ 0 Feb 12 18:36 fileb </code></pre> <p>Now my question: Why did git change the timestamp of file <code>fileb</code>? I'd expect the timestamp to be unchanged.</p> <p>Are my commands causing a problem?<br> Maybe it is possible to do something like a <code>git checkout . --modified</code> instead?</p> <p>I am using <code>git version 1.6.5.1.1367.gcd48</code> under mingw32/windows xp.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload