Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9010389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:26:39+00:00 2026-06-16T02:26:39+00:00

On our server we have, for each project, 2 folders: /repository and /htdocs. Htdocs

  • 0

On our server we have, for each project, 2 folders: /repository and /htdocs. Htdocs being a clone of repository, which is the bare repo. Every developer has his own repository clone to work in. htdocs is there to preview the project to project managers.

I would like to set up a post-receive hook that automatically updates htdocs when updates are pushed from the developers.

I have following in my post-receive hook:

#!/bin/sh
GIT_WORK_TREE=../htdocs git pull origin master

However, when I push, I see following error: git error

Can anyone tell me what’s going wrong?

Note that

#!/bin/sh
GIT_WORK_TREE=../htdocs git checkout -f

works, but this is kinda slow (as the project is pretty big). It is also possible someone made some bugfixes in htdocs that would get lost with checkout -f if they weren’t committed.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T02:26:40+00:00Added an answer on June 16, 2026 at 2:26 am

    This should work:

     GIT_WORK_TREE=../htdocs GIT_DIR=../htdocs/.git git pull origin master
    

    If you don’t specify GIT_DIR, git believe the repo is still “repository” (the bare repo), which might not have a remote named “origin” (hence the error message).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have just setup our hudson server to build .NET projects which seems to
We want to have our build server send the output of each build to
At our current project we have 1. a production server, 2. a test server
We installed the django toolbar yesterday on our remote server and have been trying
Lately we been having a lot of problems with our mysql server i have
We have Windows Server 2008 as our Production server hosted in RackSpace environment. Following
We have a magento 1.5.1 installed on our server. In that the default currency
We have a WP install in the root of our server and its running
I have a server on our company intranet that runs JBoss. I want to
Our dev server was recently upgraded to PHP v5.2.13. With that upgrade we have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.