Re: renaming question
- From
David Kastrup <dak@gnu.org>
- Date
- Aug 19, 2007, 19:05 UTC
- Message-ID
- <85sl6fqr9n.fsf@lola.goethe.zz>
- In-Reply-To
- <03b401c7e28f$3c7304c0$0600a8c0@ze4427wm>
"Aaron Gray" <angray@beeb.net> writes:
Show 29 quoted lines
>>* Aaron Gray:
>>
>>> I have a very large C source project that I am converting from C to C++.
>>>
>>> Is it posssible to track changes with renamed files in GIT ?
>>
>> You don't need to rename the files if you compile them using g++. If
>> you still want to rename them, most history-related GIT commands
>> accept an -M switch which enables rename ("move") detection.
>
> For sanity they have to be renamed.
>
> I am a bit of a GIT newbie. With the -M switch what would be the
> proceedure with a single file conversion such as with test.c and
> test.cpp ?
>
> Would the following do the trick ?
>
> git add test.c
> git commit
>
> rename test.c test.cpp *
> vi test.cpp
>
> git rm test.c
> git add test.cpp
> git commit -M
>
> Many thanks in advance,There is no such thing as "git commit -M". git does not keep track of renames. It generates the rename info on the fly when you ask it for patches, log stats, blame annotations or similar.
-- David Kastrup, Kriemhildstr. 15, 44793 Bochum