git-post-receive

Git post-receive hook not working

好久不见. 提交于 2019-12-04 01:12:46
We're using git with a central repo (using Gitosis). I've created a post-receive hook to generate an email to the dev mailing list whenever changes are pushed to the central repo, and to generate documentation from the documentation folder in the git repo. Therefore, in ~git/ I've got a directory, we'll call it 'a' that contains a clone of the git repo. The post-receive hook looks like: #!/bin/bash cd ~git/repositories/a.git . ~git/post-receive-email &> /dev/null ( cd ~git/a && git pull &> ~git/pull_log.log && php ~git/a/scripts/generate_markdown_documentation.php &> ~git/doc_log.log ) The

Gitlab post-receive/update hook to forward a commit to another git repo

删除回忆录丶 提交于 2019-12-03 20:37:22
In a team we have a gitlab set up that is avialable only to our team and is meant for development purposes, pushing, branching etc and we have an official git repo to which we would like to mirror commits only from master branch (stable). I know that this can be done with use of server-side git hooks but how specifically can I do that so that the developers won't have to type anything extra and the hook will be set on gitlab (no on developers' machines - local repos) ? Take a look at this recipe . In the recipe the author propagates changes being pushed to the master to a working tree, you

Git post-receive hook doesn't remove deleted files from master

孤街浪徒 提交于 2019-12-03 20:27:27
问题 I created a bare git repo on my server and set up the following post-receive hook from this blog: #!/bin/bash while read oldrev newrev ref do branch=`echo $ref | cut -d/ -f3` if [ "master" == "$branch" ]; then git --work-tree=/path/to/my/project/live/ checkout -f $branch echo 'Changes pushed live.' fi if [ "develop" == "$branch" ]; then git --work-tree=/path/to/my/project/dev/ checkout -f $branch echo 'Changes pushed to dev.' fi done So that whenever I push locally to my server, the changes

GitLab 5.2 Post-Receive WebHook

纵然是瞬间 提交于 2019-12-03 00:21:04
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 posted JSON data. I'm not trying to do anything custom, just right out of the box, I want to receive the post-receive data at my website location (remember on the same server), and then pull from origin-master when it gets received (provided the post-receive data originating push was to the master branch). This way, the website found in /var/www is

“git push” deletes untracked remote files

谁都会走 提交于 2019-12-02 06:34:29
问题 I am running a web server that allows users to upload images to the server. However, I am using git to manage my source code, and the git push operation deletes anything on the server which doesn't match my local checkout - so I lose the images every time I run git push ! At first I thought that I might be able to protect the uploads folder, so I tried all of these things as suggested in other posts: adding the directory to .gitignore, git rm --cached -r uploads git update-index --assume

“git push” deletes untracked remote files

喜你入骨 提交于 2019-12-01 23:03:51
I am running a web server that allows users to upload images to the server. However, I am using git to manage my source code, and the git push operation deletes anything on the server which doesn't match my local checkout - so I lose the images every time I run git push ! At first I thought that I might be able to protect the uploads folder, so I tried all of these things as suggested in other posts: adding the directory to .gitignore, git rm --cached -r uploads git update-index --assume-unchanged uploads None of these solve the issue - the remote directory always disappears when I do git push

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

。_饼干妹妹 提交于 2019-12-01 06:43:52
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/<name>/bin/activate works fine for a user in the git group. When it runs as a post-receive hook after a push, I get the error "source: not found". I'm not sure where else to look - any hints much appreciated. This is something of a guess, since you haven't quoted your complete post-receive hook, but I suspect that you don't have a shebang line pointing to /bin/bash at the top. Your post-receive hook should begin: #!/bin/bash I suspect this

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

妖精的绣舞 提交于 2019-12-01 04:51:49
问题 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/<name>/bin/activate works fine for a user in the git group. When it runs as a post-receive hook after a push, I get the error "source: not found". I'm not sure where else to look - any hints much appreciated. 回答1: This is something of a guess, since you haven't quoted your complete post-receive hook, but I suspect that you don't have a

Skip processing of Git revisions in post-receive hook that have already been previously processed

梦想的初衷 提交于 2019-11-30 23:13:31
I have a git post-receive hook that extracts all the revisions that were added during a "git push" and does some processing on each one (such as sending notification emails). This works great except when merging; e.g.: I make some commits on branch1 and then push branch1. The post-receive hook processes the commits correctly. I merge branch1 into branch2 and then push branch2. The post-receive hook processes all the merged commits a second time. How can I avoid this? Below is the beginning of my post-receive hook where I extract the commits that should be processed (at the end $COMMITS holds

Git post-receive hook doesn't remove deleted files from master

大城市里の小女人 提交于 2019-11-30 15:58:01
I created a bare git repo on my server and set up the following post-receive hook from this blog : #!/bin/bash while read oldrev newrev ref do branch=`echo $ref | cut -d/ -f3` if [ "master" == "$branch" ]; then git --work-tree=/path/to/my/project/live/ checkout -f $branch echo 'Changes pushed live.' fi if [ "develop" == "$branch" ]; then git --work-tree=/path/to/my/project/dev/ checkout -f $branch echo 'Changes pushed to dev.' fi done So that whenever I push locally to my server, the changes would automatically be published on each branch's folder without the need to manually pull. I set the