[Ilugc] Git push size in pre-receive of the master

  • From: viky.nandha@xxxxxxxxx (விக்னேஷ் நந்த குமார் (Vignesh Nandha Kumar))
  • Date: Tue, 8 Nov 2011 16:34:40 +0530

Hi

On Tue, Nov 8, 2011 at 4:24 PM, Version Control Buddy <vcbuddy at 
gmail.com>wrote:

I am trying to restrict the size of the git push using a pre-recieve
hook. In the case of svn I can do it with a precommit hook by checking
the size of the transaction file. I am not sure how to do this with
git. Any suggestions ?


You can set up a pre-receive hook in git, on the remote (server-side hook).
Assuming that your remote is 'origin', you can do
$ git remote show origin
to get the url of the remote.

Then move to the path in the remote. There will be a 'hooks' directory with
sample hook scripts. You can either rename the pre-receive.sample file or
create your own. Don't forget to chmod +x the file.

-- 
Vignesh Nandha Kumar

Other related posts: