git-post-receive

Git: making pushes to non-bare repositories safe

℡╲_俬逩灬. 提交于 2019-11-27 06:24:27
问题 I could use some guidance from the git experts out there regarding making push operations to non-bare repositories safe. Basically I have a plan about how to do this, and could use some advice about whether the plan is sane or not :) Normally when you push to a non-bare repository in git, its working copy and index are not updated. As I've discovered, this can cause serious problems if you forget to later update them manually! In our group, we have a few "central" repositories that people

Jenkins and GitHub webhook: HTTP 403

北战南征 提交于 2019-11-27 01:23:27
问题 I have a GitHub repository which I would like to have notify Jenkins of new commits via a post-receive hook. I've installed the GitHub plugin into Jenkins and have allowed for Jenkins to manage it's own hook URLs. The project has the correct git repository URL and is instructed to "Build when a change is pushed to GitHub". When I have GitHub send a test payload I find this in the nginx webserver that front's Jenkins: 207.97.227.233 - - [15/Sep/2011:07:36:51 +0000] "POST /github-webhook/ HTTP

reset hard on git push

本秂侑毒 提交于 2019-11-26 14:16:15
问题 I have a post-receive hook script sitting on the remote repo I am pushing to that does a git reset --hard Something like this: $ git push opal Counting objects: 74, done. Delta compression using up to 2 threads. Compressing objects: 100% (45/45), done. Writing objects: 100% (53/53), 16.68 KiB, done. Total 53 (delta 20), reused 0 (delta 0) remote: warning: updating the current branch remote: HEAD is now at 88f1e35 tweak lavalamp styles What i don't understand here is - the remote says head is

Git Post-Receive Hook for Website Staging

懵懂的女人 提交于 2019-11-26 03:38:37
I'm trying to set up Git for staging my website so that I can git pull to get the current version to work on locally and then git push to push the changes to the remote server. I've got it set up so that it works the way I want it to, but after I push, I have to manually run git checkout -f or git reset --hard HEAD on the remote server. I've tried putting these into a shell script as the post-receive hook on the server, but it just doesn't seem to have any effect. I know that the script is running because I'm seeing "Changes pushed to server" after I push. Here's the post-receive hook: #!/bin

Git Post-Receive Hook for Website Staging

☆樱花仙子☆ 提交于 2019-11-26 01:13:58
问题 I\'m trying to set up Git for staging my website so that I can git pull to get the current version to work on locally and then git push to push the changes to the remote server. I\'ve got it set up so that it works the way I want it to, but after I push, I have to manually run git checkout -f or git reset --hard HEAD on the remote server. I\'ve tried putting these into a shell script as the post-receive hook on the server, but it just doesn\'t seem to have any effect. I know that the script