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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T19:49:04+00:00 2026-05-21T19:49:04+00:00

I thought I would throw this out there and see if I could get

  • 0

I thought I would throw this out there and see if I could get some solid advice on this.

I’ve got a production site with a rather large code base and have just installed Git on it, same with test site. And I’ve got a local box that will basically be the point of integration. Our team will push to the local box and little gnomes will come and take everything off to our different servers – or at least that’s the closest I’ve come to implementing Git.

I really don’t have the slightest clue where to begin. I’ve got a big, finicky, legacy codebase that I am scared to touch on a good day. Git is meant to be the starting point of a big cleanup process, I just don’t know how to get started.

I was thinking of creating a bare .git repo based on my production docroot (with applicable .gitignore stuff) and then cloning over to test and development environments, then individuals would clone off dev and get to work, pushing back to dev and then somehow magically telling git to update the docroot when changes to the bare repo are made.

I was going to install git-flow on development (can’t get it to work on my production server), and then push to production. Since they are just branches at the end of the day, figured I could get away with not using git-flow on prod/test servers.

This seems all well and good, I just don’t know if I should be pushing to test/prod, or pulling from dev to test/prod. Maybe just a straight git init in production docroot? Create a .git directory and git init to that? Git init git giggidy giggigdy…

Insights are appreciated.

Edit

Here’s what I ended up doing, hopefully someone else will find it useful.

Downloaded current production code to development server (LAMP)
Set up .gitignore files and ran git init within the directory and peformed initial import/commit
On Staging/Production servers:
Created YOURNAME.git directories and created bare repositories with git init –bare
Set worktree as /path/to/my/public_html, set bare to false, and set receive.denycurrentbranch to ignore
Added a line to hooks/post-receive: git checkout -f making sure that my git user had permission to write to the worktrees

Back on the development server:
git remote add [staging|production] ssh://myuser@myserver/path/to/my.git
git push [staging|production] master

To update my production and staging sites, its a simple git push [production|staging] and I don’t have to fuss with hiding a .git directory from public view.

Sources:
http://www.deanoj.co.uk/programming/git/using-git-and-a-post-receive-hook-script-for-auto-deployment/
http://toroid.org/ams/git-website-howto

Hope this helps someone!

Edit again
Also, works best on 1.7.3.3 or later. I’m running a virtualized ubuntu box for development and ran into some issues committing over Samba. After fighting with this for a couple of hours, read that the issue was fixed in 1.7.3.3. I was on 1.7.3.1.

  • 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-21T19:49:05+00:00Added an answer on May 21, 2026 at 7:49 pm

    If you’re not interested in getting into the heavier deployment solutions like Capistrano then you can set up a post-receive hook on your bare repository that checks out the latest changes into your production docroot. You could set up a separate hook for both dev and for production. Here is a pretty good guide to doing this.

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

Sidebar

Related Questions

Thought I would throw this one out there and see what other people's experiences
Alright thought I would throw this one out there for the crowd to think
I may be SOL on this but I thought I would give throw it
Before I throw something ugly together I thought this would be a good one
This is what I thought would be a simple select clause, however the following
I'm having trouble with something that I thought would be easy... I can't get
I'm trying to do something which I thought would be fairly simple. Get IIS
I am trying to do something I thought would be simple. I have a
I'm being stymied by what I thought would be the relatively simple task of
I am trying to Emit what I thought would be a simple object array

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.