Question

I'd like to set up a web design & development workflow with the following features: Local working directory which can be sync'd between my laptop and my desktop. I'll then commit this to a staging server and when I'm happy with it, copy that to the public server.

I'm mainly going to be working solo but I do want non-tech literate clients to be able to see the staging server for approval.

My web host will be Nearly Free Speech.net (NFSN) which has SSH login.

From my research, a good way to achieve this seems to be using GIT and then rsync for the final copy to the public server. However I have a few questions and was hoping people could point me in the right direction.

  • So I install GIT on both my local machines and make sure it is running on the staging server (which is a shared web space instance on NFSN). Do I also need it on the public server?

  • I commit my site to the staging server, get it tested and approved and then I'm a bit confused. Do I SSH into the public server and run rsync from there? Or do I run it from the staging server?

  • If I'm running GIT on the staging server, is there any point in having the site in a service like GIThub? Or can I 'check it out' to my various local machines from the staging server? Or would I be better with GIThub as it holds things like branches?

  • Slightly un-GIT related: Is .htaccess/.htpasswd the best way to make a login testing area for general websites? (this will be the staging server)

Thanks in advance for any help.

Paul.

Était-ce utile?

La solution

Well, it could be much easier.

You push to your staging server whenever you want, then, when you are happy to publish your code you push to the public server. In git you can have many remotes.

git remote add <name> <url>

Once you are happy you can push to stage server or push to public server, directly from the machine where you are working:

git push stage master:master
git push public master:master
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top