Jurudocs
Jurudocs

Reputation: 9165

How to separate productive/dev environment on a server with git?

Hello I'm kind of a noob when it comes to deployment...

My situation ist the following:

  1. I'm developing on my local machine in a local git repro. When I have big changes I push to github.
  2. On the production site there is a server and i want to have a development version for my customer to check out the latest fancy features and have a parallel production version of the application on that server.

Now I'm trying to have a production version on my server on the regular port 80 and another one on 81 for example on a different vm.

Now i try to get the production version out of the way. Therefore I waned to have two directories with different version/branches - one dev (let's say: home/app1-dev) and one production (let's say: home/app1).

But when i clone my repro twice i get the error destination path already exists...of course git doesn't look for directories...

I don't even know if this is a good way to make all this happen...? Are there better ways to deploy a dev version and an independent production version?

Any help or more fundamental approaches?

Upvotes: 2

Views: 326

Answers (1)

Kamil
Kamil

Reputation: 431

I am not sure what is the best approach but in my company we use 2 branches: master and prod. Prod is the stable version that is used on our production servers. Than you can use different approach to copy data to correct directory. The easiest way would be to clone the repo into destination folder (the one you server uses) and then checkout to prod branch and pull updates. You can write 'deploy' script that will checkout to prod branch in prod directory and pulls data. What excally are your problems with cloning repo?

Upvotes: 2

Related Questions