Kanishka Panamaldeniya
Kanishka Panamaldeniya

Reputation: 17586

How to handle this situation in version control GIT

Hi i am planning to use version control using GIT and bitbucket to my system . here is my planned structure .

enter image description here

  1. I will do my all new work in trunk , all the code is in bitbucket.

  2. When i want to do a release i will copy my trunk to QA branch, all the code is in bitbucket.

  3. after QA is complete i create a tag in bitbucket .

  4. from QA branch i do a relase to production branch

    Using git and bitbucket i can manage my code . control my versions

My problems are these

  1. my Devleopment server which i want to keep trunk code is outside of bitbucket .
  2. my QA server which i want to keep QA branch code is outside of bitbucket .

So how can i sync the data inside bitbucket with QA server and Developement server up to date .

when i commit a code to trunk in bitbucket i need my development server code should be updated . also when i commit a code to QA branch in bitbucket i need my QA server code should be updated

is it possible ?

my project is PHP 
My QA and Development servers using LAMP.

Upvotes: 0

Views: 70

Answers (1)

CodingWithSpike
CodingWithSpike

Reputation: 43748

Depending on your specific setup, you could potentially use BitBucket's hooks to automatically notify your QA server that there are changes checked in, then it could pull the new data from BitBucket.


Another alternative is to just push your code from your dev machine. Your QA server could have a Git server on it that you can push code to. Normally I would handle this by having 2 "remotes" set up in Git. Then you could:

git checkout qa-branch  # switch to QA branch
git merge trunk  # bring code changes from trunk into qa branch
git push bitbucket qa-branch  # save qa branch to bitbucket
git push qaserver qa-branch  # update qa server

On the QA server, you could use Git hooks to respond to code being pushed, and run a script to deploy the code.

I think this is basically what Heroku does when you push code to them.

Upvotes: 1

Related Questions