1

At the minute I have a local git repo which sits in H: drive. When I make changes to the files and save them, they are stored here. I can then commit, push and pull the files and branches to and from a remote repo on my git server.

What I would like to do is work on files and instead of saving them to the local H drive I would like to save them onto my test server, so that they can be run and tested from that server in a browser. When all of the testing is complete I would like to merge the files from the test server to the live server and have them there as the live system or would I need to pull files from my test server and from my live server and merge them locally and push the master branch back to the live server?

Also when the branches are merged into my live master branch and pushed to the live server, how would I 'unpack' all of the files from the git repo so they can run as the live site.

I have experimented with git archive and read up on git bundle to try and see if this would allow me to do an 'unpack' of sorts, but so far I haven't been able to achieve anything I can really work with.

Is it possible for this to work the way which I have described it and if so how would you go about doing it?

If it isn't possible or if there is a better way to do this which I have overlooked, please let me know.

MikeyJ
  • 394
  • 1
  • 4
  • 16
  • Sounds like you need to look into FTP (File Transfer Protocol). Your current working environment may also be important as some things work well on windows that don't work on linux or Mac and the reverse can also be true. If you have a hosted production site, your host may provide some of the tools you are looking for. – RockyFord Nov 09 '12 at 12:17

2 Answers2

1

I don't know what you mean with the unpacking thing but I guess what you are looking for is a possibility to deploy changes. Let's say you are developing your app and you use a staging or dev branch for that. Now, if you want to test your app at your testserver you first have to push everything to your repository. You might want to look into Capistrano. With Capistrano you can easily deploy your app no matter what programming language you are using. The Procedure for that would be to install Capistrano first using "sudo aptitude install capistrano" or even better "gem install capistrano". Now that you have it you can go to your app locally and type "capify ." Since you have multiple branches you want to deploy to different servers have a look at Capistrano Multistage Ext. Now Capistrano should create some files and you should open .config/deploy.rb and insert your data for your repository, your targetserver and the branch you want to push to the targetserver. There are several HowTo's but the default.rb should look pretty familar to you. Now through Capistrano your Test Server is linked to the Staging branch of your repository and you can use "cap staging deploy" to deploy your app to the test server via ssh. In case everything works you can locally merge the staging branch into the master and push it into your repository. Now since your Live system should be linked to the master branch of your repo you can type "cap production deploy" to have the app working on your live system. You might have to care about database migrations but overall that's it.

A quick install/config and you have a way better workflow than you have now.

In case you don't have ssh access to your server you might have a look at git-ftp. Hope this is a help for you to solve your problem.

gulty
  • 1,058
  • 1
  • 8
  • 13
0

If your test server is on your LAN, you can just install Samba on it, and then mount its webroot as your H: drive. If it's a remote server, some sort of SSHFS client (such as Expandrive) might work.

Derrick Miller
  • 1,435
  • 17
  • 31