0

I have git instaled on Ubuntu, I'd like to use git combined with my own server, so that as I change files in a certain branch, commit and push it to the server it automaticly updates the files and is visible on the website, when I checkout to another branch I'd like my website to change automaticly to, so that the branch fits with what is visible on the website.

Is all that possible ?

Ozerion
  • 9
  • 3
  • 1
    What is your motivation to be able to switch branches on your live server? That's a strange request, and there may be a better solution to solve your problem. – ChrisGPT was on strike Apr 23 '15 at 12:35
  • @Chris This is a slipshod way to do it, but I can see *why* OP wants to do that: Create local branch -> make changes -> deploy new changes to server to test. Being able to do `git push toTestServer` from the current branch would be convinient – RaGe Apr 23 '15 at 17:19
  • @Ozerion what server are you using? Gulp or possibly Grunt are pretty useful to start a server with your current state of changes for quick testing. You can beat git into doing deployments for you, but it isn't really meant for that use case. – RaGe Apr 23 '15 at 17:21
  • Thanks for answering ! :) @RaGe I'm using a 1&1 server for my website. At this very moment I'm using a localhost to "simulate" what I'd like to do on my 1&1 server : my /var/www/html/project folder is git initialized, I've also set up git flow on it. so when I checkout on a feature branch It switches the website "version" and I can see directly this version in my browser at "localhost/projet". I'd like to do the same but with my 1&1 server... is that possible? – Ozerion Apr 28 '15 at 15:45

0 Answers0