Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git diff patch without /a /b?

Tags:

git

diff

patch

i have a local repository and i created a patch.txt (from the first to the last commit) using the following command:

git diff commitid1 commitid2 > patch.txt

But if i look at this patch.txt i see 2 directories /a and /b. And all the files are pointed always to 2 different directories (/a and /b)? How come? I have only one local repository

How do i create a patch so without /a and /b only from one directory?

Thanks!

like image 793
Meez Avatar asked Feb 11 '23 14:02

Meez


1 Answers

This will do what you want

$ git diff commitid1 commitid2 --no-prefix > patch.txt

See --no-prefix over at http://git-scm.com/docs/git-diff

like image 181
Tim Avatar answered Feb 14 '23 10:02

Tim