I have an application (.exe) I wrote which takes a file path and performs some custom formatting on the file passed in. I would like to know if there's a way using git pre-commit hooks to pass in the changed files being committed to my .exe so they can be formatted before going to the git repository. If so how? I don't know php so if there's a way to do this using c# or .bat file I'd prefer this. If there's a different better approach i'm open to that also.
Asked
Active
Viewed 216 times
1 Answers
0
That would be the job for a content filter driver (a clean
one), not a pre-commit hook.
See "Protecting files in git repository": you can declare a script which will apply to only certain files, automatically on commit.

VonC
- 1,262,500
- 529
- 4,410
- 5,250
-
I read the post from your link thank you. However, i don't see how i can leverage that information for what i'm trying to do. Is it possible you could provide some more detail to help me out? – johnsontroye Mar 19 '18 at 15:18
-
@johnsontroye I don't have much beside that post: the first step is to be able to write a script able to revert the custom formatting back to the original file content. – VonC Mar 19 '18 at 16:26