What I am trying to say politely is that your lack of knowledge on how Git works constitutes neither a valid support request, nor a bug in our software. It is not covered by your support subscription. We only provide support for our software.
As you explicitly stated yourself, the feature in our software works correctly. It's supposed to delete the files in the site's temporary folder. It deletes the files in the site's temporary folder. Therefore, the logical conclusion is that you should not put a file you need to keep in the tmp folder OR you must not use this feature. You already know that, you told me you understand it, so there's really nothing for me to tell you about something which works correctly and you understand correctly. As a result, the problem is that you don't understand how to use Git. That's what I understood the first time, and now in this second time.
As I told you, you do need to read up on .gitignore. I was not being dismissive, it's really what you need to do! Maybe, read a tutorial for beginners: https://linuxize.com/post/gitignore-ignoring-files-in-git/ Then, the solution is obvious.
Create the .gitignore file in the repository's root (in your case, this is the site's root) so it is not getting deleted automatically. Halfway done.
Add the line
/tmp/**
to the .gitignore. This excludes the files inside your tmp folder. Yes, it also excludes the tmp folder itself because Git does not index and commit folders, it indexes and commits file differences. For the same reason this won't magically remove temporary files from your live sites. If this is not obvious, sorry, you need to read more about how Git works — and maybe you'll realise why using Git to deploy CMS-based sites is not the best of ideas.
Finally, add the .gitignore file in your repository.
Nicholas K. Dionysopoulos
Lead Developer and Director
🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!