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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:17:44+00:00 2026-06-06T06:17:44+00:00

I am not an expert in Git, but I have seen this done before

  • 0

I am not an expert in Git, but I have seen this done before (I just didn’t know the actual implementation behind it).

I have my main website at http://www.foobar.com but I want to have a testing subdomain at beta.foobar.com (or if that’s too complicated, a testing dir at foobar.com/beta)

Is there a way to have 2 branches in my Git repo that manage the main website and a subdomain so that I can do all my testing in beta, and when I find my code satisfactory, I can simply merge beta in the master branch?

If I am thinking about this problem the wrong way, please feel free to propose an alternative. Thanks!

  • 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-06T06:17:45+00:00Added an answer on June 6, 2026 at 6:17 am

    This is pretty easy to achieve and is nothing specific to GIT, but depends on your webserver settings and the deployment process for your app. 2 easy steps:

    1. Configure your web server to serve both http://www.foobar.com and beta.foobar.com. Serve the different domains from different web-roots, e.g. main app from /var/www/foobar.com/app/public and subdomain from /var/www/foobar.com/subdomains/beta/public
    2. For deployment, simply clone the master branch into .../app/public directory and the beta branch into .../subdomains/beta/public

    The process can also be automated with tools like Capistrano and the multistage extension.

    EDIT in response to your comment:

    In a serious project that you are not just doing for yourself, you should never update the files that are currently deployed. Here is the proposed setup:

    1. Have a bare git repository – either accessible on your server or on github.com (or any other provider)
    2. Clone the repository on your development machine – this is the code you’ll be working on
    3. Suppose a change in the beta branch: push that change
    4. Now you can clone your beta branch of the bare repository into your deployment path for beta
    5. Whenever you feel ready: pull beta into master (on your dev machine)
    6. Push master
    7. Deploy master by cloning bare repository master branch into deployment path for master

    As noted above, tools like capistrano make deployment dead simple and they can even keep a history of your different deployments. Look at this post for example to see how it is used for PHP deployments.

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

Sidebar

Related Questions

I'm not exactly an expert at this, but I'm pretty sure I have covered
I'm not expert about css menus. But I know basic system to make css
I have read this thread when I got the the git: command not found
I'm not very expert on how processors work, but one might imagine that it
I'm not php expert and I don't know what's the difference(1) between a and
I'm not very expert in using javascript and jquery but I'm working with them
I am receiving this error when I try to use git lately. I'm not
I am not expert in ASP so i would be appreciated for the help.
I am not AXIS2 expert, therefore I am using Eclipse to generate bottom -
I am not an expert web-dev so please bear with me here. I would

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.