Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "J.O. Aho" Newsgroups: alt.os.linux Subject: Re: patch a file with the patch command Date: Mon, 5 Aug 2024 23:05:24 +0200 Lines: 29 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net SoMX7AS8wCkFJuHsmCSZMQNW38FNhDN85D93vWZTCy1EZ7NMU7 Cancel-Lock: sha1:2ESPJTHNacs/q3cFpE0iE0xVwh4= sha256:/b0WAtDJ1WFaKzgTUms63ShvtSGE8LpGRrgsvfI314M= User-Agent: Mozilla Thunderbird Content-Language: en-US-large In-Reply-To: Xref: csiph.com alt.os.linux:80265 On 05/08/2024 17.33, alex wrote: > > patch -p1 < ../from_org_to_revised.patch > > The parameter -p1 what is it for? > it's to remove the first level of directory as in my example the paths had been --- orgcopy/orig 2024-08-02 14:22:59.937683379 +0200 +++ revisedcopy/orig 2024-08-02 10:17:25.108469758 +0200 so -p1 would make it same as: --- orig 2024-08-02 14:22:59.937683379 +0200 +++ orig 2024-08-02 10:17:25.108469758 +0200 Say you had had: --- src1/dir/orig 2024-08-02 14:22:59.937683379 +0200 +++ src2/dir/orig 2024-08-02 10:17:25.108469758 +0200 and you are in the src1/dir applying the patch, you would like to remove two levels and use -p2, but if you had been in src1 then you would just use -p1. I hope that was understandable... -- //Aho