On 2016-08-12, at 8:42 AM, Pablo Rodríguez <oi...@web.de> wrote:

> Dear list,
> I’m writing a book with git as control version system.
> I have been writing over 300 pages in a file named `my-book.tex`. Now I
> realize that I should start it from scratch. So I just `git mv
> my-book.tex old-draft.tex`.
> The new book will have also a `my-book.tex` file. The file has been
> added to git (at I commited some changes) with the name `new-book.tex`.
> Would it be problematic in the future if I `git mv new-book.tex
> my-book.tex`?
> I assume that git history will include the name change and it won’t
> change file contents. Is that right or am I missing something?
> Many thanks for your help,
> Pablo
> -- 
> http://www.ousia.tk

It sounds like you have a concern about git tracking changes in a file based on 
the name of the file.

Git actually matches files based on their content more than their name or the 
blob that they came in. While I have not seen this myself, others have told me 
that git can even tell if a file is split into two parts, and track which lines 
came from which file.

So having a file move to "old", and something else come in with the same name 
but different content will not be a problem -- git tracks the content changes 
more than the file name.

Entertaining minecraft videos

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to