Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>'<code>git-log -M</code>' will give the commit history with rename information, as mentioned <a href="https://git.wiki.kernel.org/index.php/GitFaq#Why_does_Git_not_.22track.22_renames.3F" rel="nofollow noreferrer">in GitFaq "Why does git not "track" renames ?"</a></p> <p>The <code>diff</code> machinery in Git has support for automatically detecting renames, this is turned on by the '<code>-M</code>' switch to the <code>git-diff-*</code> family of commands.<br> The rename detection machinery is used by <a href="http://git-scm.com/docs/git-log" rel="nofollow noreferrer"><code>git-log</code></a> and <a href="http://www.kernel.org/pub/software/scm/git/docs/git-whatchanged.html" rel="nofollow noreferrer"><code>git-whatchanged</code></a>.<br> Git also supports a limited form of merging across renames. The two tools for assigning blame, <a href="http://www.kernel.org/pub/software/scm/git/docs/git-blame.html" rel="nofollow noreferrer"><code>git-blame</code></a> and <a href="http://www.kernel.org/pub/software/scm/git/docs/git-annotate.html" rel="nofollow noreferrer"><code>git-annotate</code></a> both use the automatic rename detection code to track renames.</p> <p>As a very special case, <a href="http://git-scm.com/docs/git-log" rel="nofollow noreferrer">'<code>git log</code>'</a> version 1.5.3 and later <strong>has '<code>--follow</code>' option that allows you to follow renames when given a single path</strong>. </p> <hr> <p>in your example:</p> <pre><code>F:\prog\git\test\rename&gt;git log --follow bar commit 81f52b91eb2fc7ad18051c93f3e4d583f27c15ca Author: VonC &lt;&gt; Date: Tue Jun 2 21:54:43 2009 +0200 renamed foo to bar commit 71aff26ace6ab249ab2042d1e5d20377486ce478 Author: VonC &lt;&gt; Date: Tue Jun 2 21:54:19 2009 +0200 edited foo commit c893199da767eddac6a547b940557435ade4d18c Author: VonC &lt;&gt; Date: Tue Jun 2 21:53:51 2009 +0200 initial commit </code></pre> <hr> <p>Note: all of this is possible because you did not drastically modified content of <code>foo</code> before renaming to bar. If the content was entirely different, the <code>--follow</code> option would not been able to get the all history.</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