Re: "git apply" can't add new files to repo ?

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

 



thanks all for your replies.

yang

On Fri, Jul 15, 2011 at 12:39 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Yang <teddyyyy123@xxxxxxxxx> writes:
>
>> I created a patch by "git format-patch", and this patch includes some
>> newly-added files.
>>
>> when I got back to the original branch, and apply this patch, the new
>> files appear, but they are not
>> added to git repository, so I have to manually find all the new files
>> and do "git add" for each of them.
>
> You are doing and thinking wrong.
>
> $ git apply patch
> $ git commit
>
> would not add any new contents to existing paths either.
>
> $ git apply --index patch
> $ git commit
>
> would be the way, but that is why we have "git am".
>
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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]