Re: Merge selected files or folders

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



<stefan.naewe@xxxxxxxxxxxxxxxxxxxx> writes:

>> Assuming a history of this shape:
>> 
>>       x---x---X (that other branch)
>>      /
>>     O---o---o---o---H	(current branch)
>> ... 
>>     $ git checkout H
>>     $ O=$(git merge-base X H)
>>     $ git diff $O X -- thisdir/ that/file | git apply
>>     $ git commit -m "picked changes from branch X"
>
> Isn't that the same as simply checking out the files/folders of
> "that other branch" and commiting the result ?
>
> $ git checkout X -- this/dir that/file
> $ git commit -m "picked changes from branch X"
>
> Or am I missing something ?

You would lose the changes the history O..H made to this/dir/** and
that/file if you did that, no?





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux