git-post-receive

Are concurrent git pushes always safe if the second push only has fast-forwards from the first push?

核能气质少年 提交于 2019-11-30 12:49:05
I want to automatically push commits in the post-receive hook from a central repo on our LAN to another central repo in the cloud. The LAN repo is created using git clone --mirror git@cloud:/path/to/repo or equivalent commands. Because the files being committed will be large relative to our upstream bandwidth, it's entirely possible something like this could happen: Alice initiates a push to the LAN repo. Bill pulls from the LAN repo while the post-receive hook is running. The LAN repo is in the middle of pushing to the cloud repo. This also means Bill's local repo contains the commits Alice

Make Github push to a remote server when it receives updates

北战南征 提交于 2019-11-30 12:36:13
What is the set up for having Github automatically push any updates to a remote server? This is useful for maintaining a codebase on Github, and having a website run off that codebase. I have my repo on my own computer, this is where I work. I commit my changes on my local repo, and push them to my Github repo. I want my Github repo to then push these changes to my remote server. I've been researching all day, and using the 'hooks' sounds reasonable. Maybe using a 'post-receive' hook on Github which then runs a push command to my remote server. Any suggestions? As I understand github doesn't

Git post-receive hook not working

柔情痞子 提交于 2019-11-30 09:35:12
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 set up a post-receive hook on my central remote repository that runs the force build function of Hudson. I've created a post-receive file called "post-receive" in the hooks directory in my central Git repository, the one that is pushed to from the developers' local branches. They each push to their own branch on the central repository. I want to

Make Github push to a remote server when it receives updates

梦想与她 提交于 2019-11-29 17:50:46
问题 What is the set up for having Github automatically push any updates to a remote server? This is useful for maintaining a codebase on Github, and having a website run off that codebase. I have my repo on my own computer, this is where I work. I commit my changes on my local repo, and push them to my Github repo. I want my Github repo to then push these changes to my remote server. I've been researching all day, and using the 'hooks' sounds reasonable. Maybe using a 'post-receive' hook on

Git post-receive hook not working

孤街浪徒 提交于 2019-11-29 14:42:07
问题 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 set up a post-receive hook on my central remote repository that runs the force build function of Hudson. I've created a post-receive file called "post-receive" in the hooks directory in my central Git repository, the one that is pushed to from the

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

泪湿孤枕 提交于 2019-11-29 02:21:12
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 server. To exemplify: Pushing the 'develop' branch copies to 'develop' sub-folder. Pushing the 'master' branch copies to the 'master' sub-folder. The problem we are having is getting the post-receive hook to do this. Here is what we currently have: #!/bin/bash while read oldrev newrev ref do branch=`echo $ref | cut -d/ -f3` if [ "master" == "$branch"

git post-receive not working correctly

戏子无情 提交于 2019-11-28 23:44:51
I have the following problem. I have updated the 'post-receive' to cd into a certain directory and then pull the repo in to deploy it like so: #!/bin/bash cd /var/www/site git pull origin master However whenever I do 'git push origin master' on my local machine I get the following: Counting objects: 5, done. Delta compression using up to 2 threads. (etc..) remote: fatal: Not a git repository: '.' Yet when I manually cd to /var/www/site and do git pull origin master it works brilliantly. Hasintha Janka Use unset GIT_DIR as following #!/bin/bash cd /var/www/site || exit unset GIT_DIR git pull

Jenkins and GitHub webhook: HTTP 403

折月煮酒 提交于 2019-11-28 06:33:18
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/1.1" 403 561 "-" "-" I was running SSL so I disabled it to no effect. Do I need to provide special

git post-receive not working correctly

我的未来我决定 提交于 2019-11-27 15:02:52
问题 I have the following problem. I have updated the 'post-receive' to cd into a certain directory and then pull the repo in to deploy it like so: #!/bin/bash cd /var/www/site git pull origin master However whenever I do 'git push origin master' on my local machine I get the following: Counting objects: 5, done. Delta compression using up to 2 threads. (etc..) remote: fatal: Not a git repository: '.' Yet when I manually cd to /var/www/site and do git pull origin master it works brilliantly. 回答1:

reset hard on git push

北城以北 提交于 2019-11-27 08:41:17
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 now at XXX but when i log into the server - the remote working copy is not updated at all! any idea?