Thread (6 messages) 6 messages, 4 authors, 2016-06-15

Re: git index: how does it work?

From: Sverre Rabbelier <hidden>
Date: 2016-06-15 22:47:13

Heya,

On Wed, Aug 12, 2009 at 04:52, Shaun Cutts[off-list ref] wrote:
Are renames being tracked by the index, and is there a more basic interface
than "status" to query about them?
Nope, git never explicitly tracks renames. Try this:
$ mv foo bar
$ git rm --cached foo
$ git add bar
$ git status

It'll tell you that you renamed foo to bar, even if you never executed 'git mv'.

This is because git does rename _detection_, that is, it'll notice
that you have another file with (almost) the same contents, so it
assumes you did a rename.

-- 
Cheers,

Sverre Rabbelier
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help