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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:07:00+00:00 2026-05-17T01:07:00+00:00

Edited: (after seeing Luke’s answer) I’m looking to develop a website and all the

  • 0

Edited: (after seeing Luke’s answer)

I’m looking to develop a website and all the work will be done remotely (no local dev server). The reason for this is that my shared hosting company a2hosting has a specific configuration (symfony,mysql,git) that I don’t want to spend time duplicating when I can just ssh and develop remotely or through netbeans remote editing features.

My question is how can I use git to separate my site into three areas: live, staging and dev.

Here’s my initial thought:

public_html (live site and git repo)
testing: a mirror of the site used for visual tests (full git repo)
dev/ticket# : git branches of public_html used for features and bug fixes (full git repo)

Version Control with git:

Initial setup:

cd public_html  
git init  
git add *  
git commit -m ‘initial commit of the site’  
cd ..  
git clone public_html testing  
mkdir dev

Development:

cd /dev
git clone ../testing ticket#
all work is done in ./dev/ticket#, 
then visit www.domain.com/dev/ticket# to visually test
make granular commits as necessary until dev is done
git push origin master:ticket#  
if the above fails:
    merge latest testing state into current dev work: git merge origin/master
    then try the push again
mark ticket# as ready for integration

integration and deployment process:

cd ../../testing
git merge ticket#  -m "integration test for ticket# --no-ff (check for conflicts )
run hudson tests

visit www.domain.com/testing for visual test  

if all tests pass:  
    if this ticket marks the end of a big dev sprint:  
        make a snapshot with git tag  
        git push --tags origin  
    else  
        git push origin
        cd ../public_html
        git checkout -f  (live site should have the latest dev from ticket#)
else:
    revert the merge: git checkout master~1; git commit -m "reverting ticket#"
    update ticket# that testing failed with the failure details

Snapshots:

Each major deployment sprint should have a standard name and be tracked.
Method: git tag
Naming convention: TBD

Reverting site to previous state

if something goes wrong, then revert to previous snapshot
and debug the issue in dev with a new ticket#. Once the bug is fixed, follow
the deployment process again.

My questions:

1-Does this workflow make sense, if not, any recommendations
2-Is my approach for reverting correct or is there a better way to say ‘revert to before x commit’

Thanks for taking the time to read this VERY long post 🙂

  • 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-17T01:07:01+00:00Added an answer on May 17, 2026 at 1:07 am

    I’m only going to address questions 1 – 3 (and briefly 5). Firstly, I don’t think you should have your canonical repository hosted on your production server.

    Since you don’t want to set it up locally, I’d suggest you create the repository somewhere on your server other than public_html, push it out to GitHub (or your choice of Git hosting), then git clone it in public_html, etc.

    Further, I would use master as the production branch, creating feature branches for development, then merging them into staging to test before pushing to master after testing on staging.

    To recap:

    public_html – master branch checked out – just do a git pull to update
    staging – staging branch checked out
    dev – whatever feature branches you are working on, etc

    This is just one git branching strategy, but it’s one that my team has used successfully.

    As for 3, you’ll want to setup Hudson so that it pulls the latest changes on staging automatically. See What's the workflow of Continuous Integration With Hudson? or look at the sidebar to the right to figure out how to get that working. The point of CI is that it needs to be automated, otherwise it’s not CI 🙂

    Finally, an easy way to limit access to a site is using an .htacess file (assuming your host uses Apache, which they seem to). See http://httpd.apache.org/docs/2.2/howto/htaccess.html or Google .htaccess.

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

Sidebar

Related Questions

I edited the question after David Hanak's answer (thanks btw!). He helped with the
EDITED and refined my question after Johannes's valuable answer bool b = true; volatile
[Edited: After cross-testing on a fresh machine and some additional research, this appears to
I edited this question after i found a solution... i need to understand why
I just started having a problem where Apache will automatically restart after every few
Edited after getting answers Some excellent answers here. I like Josh's because it is
I'm building a Zend website.The project (local) has the following structure: /app /controllers /views
Edited at the request of commenters. I hope this is compliant. First post! Trying
Edited: I want to get the actual with of the document with JS. I
(Edited for clarification) My (non-OSGi) application build is in Gradle, and I am trying

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.