https://github.com/milanowicz/githooks
BASH Shell Scripts for Gitolite for git repository hooks to log or automatic checkout (copy) somewhere you want.
https://github.com/milanowicz/githooks
Last synced: 2 months ago
JSON representation
BASH Shell Scripts for Gitolite for git repository hooks to log or automatic checkout (copy) somewhere you want.
- Host: GitHub
- URL: https://github.com/milanowicz/githooks
- Owner: milanowicz
- License: gpl-3.0
- Created: 2014-08-17T21:24:21.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-08-05T13:03:42.000Z (almost 10 years ago)
- Last Synced: 2025-01-23T21:26:12.794Z (4 months ago)
- Language: Shell
- Homepage:
- Size: 207 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [GitHooks](https://github.com/Milanowicz/GitHooks)
BASH Shell Scripts for Gitolite to handle git repository hooks.
It will log and checkout a git repository automatic somewhere you like.## Installation
Create GitHooks repository by gitolite-admin.git and connect to your server
`# su git`
`$ cd`
`$ mkdir Shell`
`$ nano /home/git/local.conf`
GitUser=git
GitGroup=git
GitCheckoutUser=root
MasterBranch=master
WWWUser=apache
WWWGroup=apache
WWWRightDirectory=770
WWWRightFiles=660
WWWRightScript=771
HookPath=/home/git/Projects
GitRepoPath=/home/git/repositories/
GitHooksScriptPath=/home/git/
! One empty row only at the end of this file !`$ chmod 660 ~/local.conf`
`$ nano repositories/GitHooks.git/hooks/post-receive`
#!/bin/bash
~/Shell/Deploy.sh`$ nano repositories/GitHooks.git/hooks/pre-receive`
#!/bin/bash
~/pre-receive.sh`$ chmod +x repositories/GitHooks.git/hooks/post-receive`
`$ chmod +x repositories/GitHooks.git/hooks/pre-receive`
`$ exit`
When checkout user not equal to webserver user, then edit `visudo`.
`# visudo`
ALL = () NOPASSWD: /bin/sh /home/git/Projects/*
Copy the `pre-receive.sh` and `Shell/Deploy.sh` to your server, then
you can push the GitHooks project and it will be checkout.## Create Git Hooks
You can create git hooks by the `CreateRepoHook.sh` shell script
`# su git`
`$ cd`
`$ bash Shell/CreateRepoHook.sh `
## Create Git Hooks by hand
`$ nano Repository.git/hooks/post-receive`
#!bin/bash
~/post-receive.sh`$ nano Repository.git/hooks/pre-receive`
#!bin/bash
~/pre-receive.sh`$ chmod +x Repository.git/hooks/post-receive`
`$ chmod +x Repository.git/hooks/pre-receive`
## License
[GNU GPL Version 3](http://www.gnu.org/copyleft/gpl.html)