Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!



Share:
Notifications
Clear all

[Solved] Lazarus Pascal - Git - How to make a clean patch file (Diff) by excluding certain files

1 Posts
1 Users
0 Reactions
8 Views
 Hans
(@hans)
Famed Member Admin
Joined: 13 years ago
Posts: 3098
Topic starter  

Making a modification I learned how to exclude certain files when making a patch file (thanks n7800!).

Normally one would use

git diff > todo.patch

But with Lazarus Pascal this would come with unwanted PO and POT (translation) files, and (under macOS anyway) lazarus.app and startlazarus.app (exclude sections).
Sometimes it also coms with unwanted white space which we'd like to exclude as well (-w option).

All options together this would make

git diff -- . ':(exclude)*.po' ':(exclude)*.pot' ':(exclude)lazarus.app' ':(exclude)startlazarus.app' -w > mychanges.patch

Running this in the Lazarus directory will create a nice and clean Diff file (for small changes).

Hope this is useful for others, at least a nice reminder for myself.



   
ReplyQuote
Share: