I've been using TortoiseGit for my C source code. For release V1.0 I've added the output project.hex file to the repository, so that I have the exact file is preserved / archived.
I would only like to preserve the *.hex file for firmware releases, not for intermediate commits. How do I ignore the *.hex file changes and only select it to be committed in specific instances?
You could add and commit the file and then mark it as "Skip worktree" (using Commit dialog or file properties). This makes git to ignore changes to that file (i.e., it won't show up in the commit dialog).
Then, when you prepare a new release unmark it, commit it and mark it again.