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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:20:10+00:00 2026-05-25T19:20:10+00:00

Situation I’ve never before used git or any other version control. Now I’ve got

  • 0

Situation

I’ve never before used git or any other version control. Now I’ve got a web-project that needs to have a stable and a developement version, with both running on the same server in different directories.

  • Stable: /var/www/afod/afod
  • Development: /var/www/afod_dev/afod

Now I want to use git to sync changes from the dev-version into the stable-version and as I’ve never before used VC-systems I don’t seem to get how to do this.

What I have done until now

I created a git repository in /var/www/afod/afod and cloned it into the dev directory via:

cd /var/www/afod_dev/afod
git clone /var/www/afod/afod

Now I’ve got 2 repositories which I want to keep synchronised using git pull on the stable-version side.

The problem(s)

I’ve already got 2 branches, web and dev. But as it seems git pull in the stable-version syncs from both branches. But I only want to sync the changes to the stable version, that I have already merged to the web-branch in the dev-version.

total confusion

I hope I could somehow point out my problem. I seem to have a basic understanding problem of how git works, but it seems to be the right software to do what I want to do. I basically want to have a branch that is automatically synced into the stable version and other branches I merge into it. But the developement must be in a different directory than the stable version is.

Concerning the first answer from Billy Moon

Well, stable and dev are hosted under a different domain in a different apache vserver. It wouldn’t make any sense to work on a dev-branch that is in the directory people see when they browse the site.

So my idea was to clone the repository and then sync these.

Do I get something wrong here? How do you deal with such configurations?

  • 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-25T19:20:11+00:00Added an answer on May 25, 2026 at 7:20 pm

    Branches

    I think you are on the right track, but a llittle confused with the idea of a branch. You can visualize a branch as two branches on a tree. Both have the same trunk, source, but the tips are different. The differences are between the same code base and can be minor or major. When you run the command git checkout <branch_name> you are telling git you want different tips of the tree to be active, copied into the working directory.

    In your case, one branch has the development code, and the other has your stable code. To get the code from the dev branch into the web branch, you use git merge <branch_to_pull_in> This combines the tips of those two branches so their content is the same. For more information on branches in general, Here is a generic non git page.

    Possible Solution

    Below is a solution that could work for you. There are other possible work flows, but this is one of the simplest ones.

    Clone your development repository into /var/www/afod/afod. Than from within /var/www/afod/afod run git checkout web and from your devfolder, ensure that you are on the dev branch. git branch should have a line like this * dev.

    You now have two different branches of the same repository checked out into different subfolders. Do your work in dev as you have. Once you feel it is stable, from within your dev folder run git checkout web. Than, git merge dev. This will merge those changes into your web branch. Now from within /var/www/afod/afod run git pull. This will pull your chnages into the production server. Both dev and web will be pulled over, but only the one that is checked out will be in your working directory.

    When you want to work in the dev branch again, run git checkout dev from within the dev folder.

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

Sidebar

Related Questions

Situation: I have a simple XML document that contains image information. I need to
Situation: text: a string R: a regex that matches part of the string. This
Situation: you've got a .swf embedded in an html page, and when you click
The situation: I have a pieceofcrapuous laptop. One of the things that make it
The situation is this: You have a Hibernate context with an object graph that
The situation: We're out of beta and version 1.0 has been released to several
The situation is like this : Main project A. and a class library B.
Situation: Google has indexed a page in a forum. The thread is now deleted.
Situation: I've got a SVN repository with lets say 100 revisions, rev. 100 being
Situation I'm using matchbox keyboard which is X11 based application. When any application 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.