WebFaction
Community site: login faq

Hello!

I've set up a Git app at git.domain.tld I followed the steps at http://docs.webfaction.com/software/git.html and created and configured a new repo. Copied post-receive.sample to post-receive and edited as:

#!/bin/sh
GIT_WORK_TREE=/home/<user>/webapps/<app>/<project> git checkout -f
GIT_WORK_TREE=/home/<user>/webapps/<app>/<project> git reset --hard

I also ran chmod +x post-receive

I also added the remote on my local branch. I am able to push origin master with no error - example output:

Username for 'https://git.domain.tld': <user>
Password for 'https://<user>@git.domain.tld': 
Counting objects: 7, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 390 bytes | 0 bytes/s, done.
Total 4 (delta 2), reused 0 (delta 0)
To https://git.domain.tld/<repo>.git
   3a14af4..034943b  master -> master

however I can not see the changes in /home/<user>/webapps/<app>/<project>.

I guess I should mention I have a few other repos that are working properly but I don't recall doing anything special.

Any idea?

Alexei

asked 11 Dec '13, 07:55

Alexei
8136
accept rate: 0%

Based on the information you've shown here it looks correct. It seems like there might be some missing detail, and my guess is that the post-receive hook is never being executed (rather than encountering an error).

The first step is to verify that guess, by adding something like "touch /home/<user>/hello_from_post-receive" and seeing if that file is created.

If the post-receive hook is really not being run, all I can think of is some sort of permissions issue or configuration setting on that repository in particular, especially if it's working for all of your other repos (which are presumably in the same git application).

(12 Dec '13, 02:46) ryans ♦♦

Ok, found it: the post-receive hook had DOS line endings.

While I used the terminal to create the file (i.e. cp-ed post-receive.sample), I connected through FTP to edit it locally. I eventually used the terminal and vim to convert the line endings: :set ff=unix

Thank you!

(12 Dec '13, 05:38) Alexei
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×111
×32

question asked: 11 Dec '13, 07:55

question was seen: 4,292 times

last updated: 12 Dec '13, 05:41

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM