Questions tagged [git-post-receive]

User defined script that is run on a git server after a git push command was issued.

A script that runs on a server after a git push command has been issued.

See http://git-scm.com/book/en/Customizing-Git-Git-Hooks

219 questions
8
votes
5 answers

Git post-receive hook not working

My setup is a windows XAMPP server, with cURL enabled, and Git and Hudson installed. Hudson polls Git every minute to look for changes, and if it finds them, it creates a build. I use this build as my testing server. This works fine. I would like to…
spanky
  • 1,479
  • 2
  • 11
  • 22
8
votes
4 answers

GIT error: fatal: /usr/libexec/git-core/git-submodule cannot be used without a working tree

I have a git repo with a submodule. I would use in post-receive hook file: git --git-dir="$GIT_DIR" --work-tree="$GIT_WORKDIR1" submodule update --init --recursive but I get the following error: remote: fatal: /usr/libexec/git-core/git-submodule…
klor
  • 1,237
  • 4
  • 12
  • 37
8
votes
2 answers

GitLab 5.2 Post-Receive WebHook

I'm running GitLab v5.2 on the same server as my production webserver (Document Root in /var/www). I'm trying to setup a standard GitLab Post-Receive Hook but am finding surprisingly little information about how to set up a script to process the…
sadmicrowave
  • 39,964
  • 34
  • 108
  • 180
7
votes
1 answer

Git post-receive hook loop though all commits

I am trying to do a post-receive hook on server side that will run some Python script once for each commit in push. I have a loop: while read oldrev newrev refname do python /local/Git/util.py $newrev $oldrev $refname done But this runs script…
Sarpens
  • 298
  • 3
  • 9
7
votes
2 answers

Git post-receive hook to checkout each branch to different folders?

The basic setup of our Git workflow is a bare repository on a local network server with two developers pushing/pulling to it. We would like to automagically copy (checkout) each branch that gets pushed to a different location on our local network…
Ben Frain
  • 2,510
  • 1
  • 29
  • 44
6
votes
1 answer

Why can't my post-receive hook run a virtualenv source command?

I have a post-receive hook that is running as user 'git'. I have a virtualenv /python/ve//bin/activate that is readable by git. Running: source /python/ve//bin/activate works fine for a user in the git group. When it runs as a post-receive…
willcritchlow
  • 721
  • 3
  • 7
  • 18
6
votes
4 answers

multiple commands are not working in git post-receive

I'm using git with trac. After push I want two thing to be done: Sending email to development team with diff If there is some special phrase in commit message (like "see #1"), then I want the commit message to be placed in trac ticket. The first…
bessarabov
  • 11,151
  • 10
  • 34
  • 59
6
votes
0 answers

How to get list of changed files in Git post-receive hook?

I need to get a list of changed files in server-side hook. Example: Local commit 1: M test.txt M test2.txt Local commit 2: M test.txt A test3.txt Both commits get pushed to the server (bare repo). I need to loop through the list of files AND…
Swiggity Swooty
  • 217
  • 3
  • 16
6
votes
1 answer

Missing git file hooks/post-receive.sample

I was using git 1.7.1 on CentOs 6 server and when I run git --bare init on my_repo.git I checked my_repo.git/hooks and I could see all hooks, including post-receive.sample. Now I'm using git 2.4.1 on Centos 7 server, and post-receive.sample file is…
Angelo
  • 905
  • 1
  • 17
  • 35
6
votes
2 answers

Understanding Git Hook - post-receive hook

I have written simple shell script to throw "success and failure message" and placed it under .git/hooks/ with all proper permissions. I want to call this script as a post-receive. But the script is not working, running the script simply works but…
Aniruddha Joshi
  • 113
  • 1
  • 2
  • 4
6
votes
3 answers

Finding the first commit on a branch with GitPython

I'm writing a git post-receive hook using Python and Git-Python that gathers information about the commits contained in a push, then updates our bug tracker and IM with a summary. I'm having trouble in the case where a push creates a branch (i.e.…
Julian Melville
  • 185
  • 2
  • 9
6
votes
1 answer

Git sparse-checkout on a remote with a post-receive script

I'm trying to figure out how to do the following (and figure out if it's even possible). I have a local git repo with a number of folders for various things, but I want to be able to deploy my website with git to my development server and really…
user1193694
  • 121
  • 1
  • 8
5
votes
2 answers

Want git post receive hook to make new commit and push

I would like my post-receive hook to be responsible for updating a version file in the repo itself, under certain conditions. So, suppose I have a file version.txt in my repository, I would like the post receive hook to update a version string…
Jacko
  • 12,665
  • 18
  • 75
  • 126
5
votes
1 answer

How can I get rid of the 'remote: ' messages that appear on every line returned by post-receive in git?

I've created a post-receive hook in git. The hook output messages to the screen, which are sent back to the git client doing the push, and outputted back. How can I get rid of the 'remote: ' text before every single line of output? It's rather…
dkulchenko
  • 640
  • 7
  • 12
5
votes
2 answers

Git post-receive hook and environment variables

I have git server running on Gitolite, under "git" system user. I added to ~/.profile of git user: export STAGE_PATH="/srv/http/stage" , as you can guess, I want to automagically put website from repo on stage when pushing changes. However it seems…
Łukasz Zaroda
  • 869
  • 2
  • 19
  • 55
1
2
3
14 15