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 6351179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:57:07+00:00 2026-05-24T21:57:07+00:00

For two weeks now I’ve been trying to implement Git at our office. Rather

  • 0

For two weeks now I’ve been trying to implement Git at our office. Rather than lack of documentation it’s the wealth of examples, tutorials and the various uses of git that have made me confused as to what is a recommended setup for web development.

I think I have a decent setup in mind, but before diving into yet another structure, I’d like to check with more experienced people. I have the following in mind:

  • Workstations push to a local staging server (A)
  • Local staging server works with gitolite to properly divide roles
  • A hook automatically pushes any change to the staging server onto the production server (B)

This is visualized below:
enter image description here

Does this make sense? We have a variety of smaller PHP websites, nothing very complicated. The doubts I have are:

  • What kind of ‘hook’ should I use for (B)?
  • Should I also run gitolite on the production server? I feel I should not, because after all it is just one user that uploads things to the server (the hook on the staging server), but I’m not sure.
  • My starting point is: we have all websites on the Production server, and not yet on the Staging server nor the Workstations. What is a convenient way of “pulling” them down to staging and workstations, at the initial setup?

Now, the following questions are some extra thoughts, not of utmost important at the moment but share your thoughts if you happen to know more:

  • For simplicity I prefer to be able to run git push from the workstation and have both the staging server and production server updated. But sometimes it might be useful to only update the staging server and check out things over there first, before going live. Is there an easy solution?

  • In reality we have not only one but several different production servers. But only one staging server. Is there a way of configuring different production servers so that git automatically pushes them out to the right server?

Thanks in advance for sharing your thoughts!

  • 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-24T21:57:10+00:00Added an answer on May 24, 2026 at 9:57 pm
    • What kind of ‘hook’ should I use for (B)?

    You should use the post-receive or post-update hooks to do that

    • Should I also run gitolite on the production server? I feel I should not, because after all it is just one user that uploads things to the server (the hook on the staging server), but I’m not sure.

    Not mandatory for the reasons you’ve mentioned, but since gitolite is pretty simple to setup it won’t hurt

    • My starting point is: we have all websites on the Production server, and not yet on the Staging server nor the Workstations. What is a convenient way of “pulling” them down to staging and workstations, at the initial setup?

    For each of them you can simply execute these commands

    cd /path/of/project
    git init
    # optionally create and edit your .gitignore file before the next step
    git add .
    git commit
    

    and then from your staging server run a git clone command.

    • For simplicity I prefer to be able to run git push from the workstation and have both the staging server and production server updated. But sometimes it might be useful to only update the staging server and check out things over there first, before going live. Is there an easy solution?

    I can’t see an easy solution for this task, however I don’t like your solution with automated production deployment, something could go bad and you’ll break your production site, so I prefer citizen conn multiple remote solution. You can manage things better with gitolite and permission handling. Everybody can push on staging server but a restricted group of people can push to production server.

    • In reality we have not only one but several different production servers. But only one staging server. Is there a way of configuring different production servers so that git automatically pushes them out to the right server?

    You could store your production server address in some text file in the project and then use the content of that file in your git hook.

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

Sidebar

Related Questions

I've been trying to get this to work for weeks now, all to no
for the past two weeks I've been working on coming up with a collision
These last two weeks have been my first experience with Castle ActiveRecord, and with
I've been running both Ruby 1.8.7 and Ruby 1.9 for a few weeks now.
Okay, I have been messing with this autocomplete stuff for 2 weeks now, and
I've been using Mercurial for a few weeks now and don't understand why when
I've been working on this site for the past two weeks and everything has
If two users edit the same wiki topic, what methods have been used in
Two weeks ago I needed a way to communicate a wcf service with a
I am new to programming (6 weeks now). i am reading a lot of

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.