Background
Recently I want to make some configuration for the entire git server in my company. Looking at the *. Sample folder in the. Git/hooks/folder, I am very puzzled. Can I run it by removing ". sample?
It turns out that the following code can be put into the pre-commit file, and "hello git!" Can be output at commit! "Message
#!/bin/shecho "Hello Git!"
Lua
Although I will have a little Bash script, it is actually not much different from it ~~
In view of the ease-of-use of Lua and the elegant use of wxlua on the Windows platform, Lua is ready to be widely used in subsequent daily work for some simple automated operations.
Therefore, I want to use the Lua script to write git hooks. First we have to install Lua,
- Resource home: http://code.google.com/p/luaforwindows/ (possibly walled)
- : Http://luaforwindows.googlecode.com/files/LuaForWindows_v5.1.4-45.exe
Then, write the pre-commit file.
#!/bin/env lua.exeprint "Hello Git From Lua!"
The volume is lua.exe, not Lua.
PS: I just opened my head. It seems that it will be a little difficult to call git log to obtain various information, but I will try again later ~
Other links
Msysgit: http://msysgit.googlecode.com/files/Git-1.7.8-preview20111206.exe
Tortoisegit: http://tortoisegit.googlecode.com/files/TortoiseGit-1.7.6.0-32bit.msi
Tortoise redmine Plugin: http://redmine-projects.googlecode.com/files/TortoiseRedminePlugin_32bit_1.1.0.8.msi