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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:16:03+00:00 2026-06-14T00:16:03+00:00

Recently we have started exploring GIT with the target of enabling our developers to

  • 0

Recently we have started exploring GIT with the target of enabling our developers to work from any place and secondly to automate the overall deployment process.

We have a central test server where we host all apps/sites for testing and/or demo purpose and once the development and testing is finalized we move the application to their respective live servers.

Whatever i have set up with GIT, is as follows
1. Create a bare repo on test server
2. Get a local clone for each involved developer, Developers will push to remote(test server) dev branch
3. Someone will merger all changes from dev branch to master branch and push it to remote
4. The test server (bare repo) has a post-receive hook, which checks out the master branch to public_html folder (using GIT_WORKING_DIR and checkout -f).

As of now, everything works good and i am able to see merge on master branch on hosted pages (on test server, of course). Now my questions are …
1. Am I doing this right?
2. I guess the post-receive hook I have set, executes on push to dev branch as well. How to avoid this?
3. How I can ship these contents to my live server? As I have some projects with large code base, checking out everything on test server and then ship it to live doesn’t looks good enough.

I’ve heard of CI servers, but as much as I know they check out locally and upload everything to live using ‘rsync’ (don’t know if it just syncs changes or uploads everything) or such tools. I just want to avoid that everything part and keep an option open to rollback, if anything goes wrong. I am good with setting up git on live servers.

  • 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-14T00:16:05+00:00Added an answer on June 14, 2026 at 12:16 am
    1. Yes. You can see other considerations at “reset hard on git push“.
    2. You can test the name of the branch when receiving the commits.
      branch=$(git rev-parse --symbolic --abbrev-ref $refname)
      See also “Writing a git post-receive hook to deal with a specific branch“
    3. a rsync is usually recommended for live server (where git isn’t necessary): it will update only what has changed.
      If you have git on live server, then various approaches are described in “Git for Websites / post-receive / Separation of Test and Production Sites“

    Regarding deployment, as seen in “Deploy with rsync(or svn, git, cvs) and ignore inconsistent state during deployment?“, deploying (even everything) in a separate directory and symlink the prod instance to that directory is a nice way of avoiding inconsistencies during deployment, and to facilitate rollback (symlink back to the previous live directory) in case of trouble.

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

Sidebar

Related Questions

I am more into front end development and have recently started exploring Backbone.js into
We have recently started using ImageResizer.Net over GDI+ for dynamically resizing images on our
Recently I have started work on a multi-threaded console based application using VB.Net and
I have recently started exploring free hosting sites where they provide free mysql and
A really basic question, I have recently started exploring Objective C and Trying to
Recently I have started work in one company. Previously I was working only with
I have started recently at the recomandation of someone from stackoverflow to use nrComm
I have recently started exploring Maven, but I feel a bit overwhelmed of all
Recently I have started learning rails and was a little surprised that the default
I have recently started using Netbeans with following stack Liferay, icefaces with jBoss. Is

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.