Jump to content

benbyf
 Share

Recommended Posts

  • 4 weeks later...

Would be extrememly interested to hear if many people work on PW sites with git and what setups / strategies they use?

Thanks

To answer your question, yes!

:)

I currently have 2 sites on DigitalOcean and one on NearlyFreeSpeech.

git is SO engrained in my workflow now, I can NOT work without it.

I have a new site that I bought hosting, ssl certificate and a year of hosting with NameCheap, but I will be leaving, actually today, because the made things a little complicated, and they lack documentation. DigitalOcean on the other hand, offers a wealth of tutorials and docs to get started and plenty of intermediate and advanced topics.

I am indeed VERY excited for 2015 :)

What about my workflow are you interested in?

  • Like 1
Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...

As a solo developer I'm finally taking the plunge into git, seems like everyone is obsessed with version controlling etc so I figure I'm a bit behind the times still manually transferring files. So I've set up git on my dev box and also on the remote server, and have bitbucket in there also. My ideal workflow is really pretty simple; Make changes and test on dev box, commit changes and push to bitbucket, and a bitbucket post hook then pushes the changes received on bitbucket to the remote server (live website) and does an automatic git update. So a simple git commit/push automatically updates my live site. Much easier than manually transferring file I grant you that.

Ok, now I have the entire PW site as the master branch. I realise I could just version control the site/templates folder but I want the entire site on bitbucket so that it acts as a backup as much as anything else. Also, as the website has a load of users altering images I want to be able to push the site/assets/files folder on the remote server bitbucket and then pull it onto my dev box every now and then, but never push it from dev to remote. There is also the issue of files such as .htaccess which should be ignored. So summarizing, I need to implement:

  • never push .htaccess or site/assets/files from dev to bitbucket, but
  • allow push of /site/assets/files from remote to bitbucket (for pull into dev)

Does .gitignore handle this scenario and can I set different gitignores for dev and remote pushes? Or is there a better way? Should I be using a separate branch of the entire PW site to version control just the site folder and keep the main branch as my "site backup"?

Please excuse if this is a basic question, I'm sure regular git users will think so, but I have to say, implementing git to this stage has been a bit of a mindf*** for me. But I'm getting my head around it now. Seems like there is a thousand ways to skin this particular cat and working out the best method for my particular workflow is, well.....

  • Like 1
Link to comment
Share on other sites

OK FWIW I've kind of achieved what I was after by creating a repo solely for pulling images (/site/assets/files) from remote server to dev box and another repo for the site/templates folder to upload all dev changes I make to the remote server. Works well enough. For the images I'm talking about almost 2000 image folders with a 10-20 images per folder so doing this sync with WinSCP every few days was a drawn out process, now it's a couple of git commands and magic happens :-) I might cron it as the icing on the cake. I'm starting to love git!

I'd still like to have the entire site as a repo for backup purposes (to bitbucket) but my understanding of git is still a little limited. I suspect I need to read up on "git submodule" to handle repos within repos. Any hints here would be appreciated. Als, I'd be interested to know how many PW users use version control to manage website deployments. is it really as common as the blogs I'm reading make it seem? Cos to be honest, getting to know git has not been cheap on my time!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...