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

  • SEARCH
  • Home
  • 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 4607342
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:41:23+00:00 2026-05-22T00:41:23+00:00

I am using GIT on my server and I am trying to get a

  • 0

I am using GIT on my server and I am trying to get a PHP file to be executed each time I update my repository. I’m trying to use my post-update hook to achieve this.

this is the code I tried:

#!/bin/sh

echo
echo "**** Pulling changes into Prime [Hub's post-update hook]"
echo

cd $HOME/www || exit
unset GIT_DIR
git pull hub master

exec git-update-server-info

php /path/to/directory/file.php

I can’t seem to get the PHP to execute. Anyone able to shine any light on this?

  • 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-05-22T00:41:24+00:00Added an answer on May 22, 2026 at 12:41 am

    exec never returns. Anything you put after the exec call is dead code.

    Remove the exec, or place it before your php line if that’s the last thing that needs to be done. (And after doing error checking if necessary obviously.)

    So for instance

    ...
    git-update-server-info
    exec php /path/to/directory/file.php
    

    Or just simply

    ...
    git-update-server-info
    php /path/to/directory/file.php
    

    (or move the statements around if your php script can be called before the git command.)

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

Sidebar

Related Questions

I'm trying to use git to clone an svn repository with std layout (using
I'm trying to set up a git post-receive hook such that when a commit
I'm trying to get a handle on using git. I've been using it on
I'm using git svn to get some git goodness with the company-mandated svn server.
So I'm using GIT, trying to push code to my remote server. on a
I am trying to start using source indexing alongside Git on our build server
I'm using gitosis to host a git repository on my home server. I've set
I'm trying to use a remote Git repository that only provides access over HTTPS
I am trying to get a git repository up and running and installed git
I am trying to clone a TFS project using git-tfs and I didn't get

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.