Commit button script

46 views
Skip to first unread message

Chris Plottke

unread,
Aug 5, 2015, 11:09:45 PM8/5/15
to GitExtensions
Is there a way to get GitExtensions to run a script each time a user presses the Commit button?
There are some files being created that are not in the repository folder that I would like to include in the repository. I have a script that would copy them to a subfolder in my repository folder and I'd like this to happen before the Commit screen shows up so that the copied files show up in the list of files to be staged.

I'm using Windows, I've tried creating a .git\hooks\pre-commit.bat as well as a GitExtensions scripts menu script on the BeforeCommit event with a local path in my repository and neither seem to run when I press commit.
The ideal solution would be one that I can easily roll out to everyone using the repository, but right now anything that works would be awesome!

Oliver Friedrich

unread,
Feb 16, 2016, 4:26:52 AM2/16/16
to gitext...@googlegroups.com
I've set up this pre-commit hook which works. Just remove the commenting hash signs.

One thing this doesn't do: show files in the staging area before committing. If you know you always want to add certain files to the commit this script will do just that (it adds the .min.js versions of .js files that are currently staged).

--
Oliver Friedrich
My professional blog: shades-of-orange.com

--
You received this message because you are subscribed to the Google Groups "GitExtensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gitextension...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

pre-commit
Reply all
Reply to author
Forward
0 new messages