Development using Roots

Now I saw your later post. In my opinion VirtualBox is wrong way to learn OS. Because it enable you to switch between OSs whenever “hard times” comes, when you dont know how to do something. If you want to learn faster stick to one OS and found your way. And, may the force (of internet) be with you.

I’m still in the cowboy coding camp unfortunately, but I’ve been taking my time and reading up on git for the past few weeks. I’ve found the greatest difficulty in establishing a workflow model that works for me, since I’m nearly always the only coder on my projects.

I actually came across what looks to be a really great playlist on Youtube: for a WordPress + git + Bitbucket workflow. I’m still working through it and trying to fully understand each step before weaving Roots and Grunt into the mix but it looks promising and it’s a very nice introduction to DVCS and WP.


I can’t comment on the quality of those videos but going from the titles it looks like a great introduction. Learning proper development practices will definitely be worthwhile. Cowboy coding can be fun at times but sooner or later it will catch up with you.

Agree with @ctx. Watch same playlist and must say that help me, more then some others. Maybe its women “touch”.

I’m following the videos and finding them useful.

When she gets to video 5 and clones the theme repo, then deletes the .git folder and .gitignore, DO NOT delete .gitignore. If you do, you’ll be keeping the node_modules directory in your repo, adds 1800 files to the repo that are only for development tools. Lesson learned. @_@

I’m actually not sure why she deletes any of the git files. Won’t those come in handy when it comes time to upgrade the theme? Confused…

@iagdotme, i’m glad you brought this topic up, as i too am currently trying to improve my workflow (also using Dreamweaver using code view). I am a lone freelancer, so up until this point didn’t really see the need for Git etc, as i am the only one dealing with the code. When the new Roots website came online, i started looking into Git, Grunt, etc and have already improved my workflow:

Created a local roots repository
learned a few git commands on how to copy and rename to my current project (usually the website name)
use grunt watch to compile my code on save
I use the following Dreamweaver extension to utilise LESS -

I too currently use Dreamweaver to push to ftp, but am investigating better ways to do this, such as has been mentioned in the above posts. I would be interested to hear how you go, and i will also update as i learn new ways of doing things.

I did think of using git-ftp (, but it looks to be a bit of a pain on windows and i still need to incorporate version control.

@cfx, thanks for the video links- am going through them now. I like that Bitbucket has free private repositories, as that was what concerned me about git.

I’ve used git-ftp for deployment, it’s pretty good. But more recently I’ve moved to using grunt as it does staging and production servers really nicely.

Instructions in the bottom of this post:

I’m interested in seeing what capistrano can do though.

I think she’s assuming you don’t want to pull changes from the source repo. Starter themes like Roots and Bones assume you’ll copy the theme and go forward with no updates from the source repo.

If you’re willing to do a little work deciding what changes to apply, I don’t think there’s any reason you couldn’t set up something like GitHub/roots/roots -> your GitHub (or Bitbucket or etc.) roots -> local master repo -> local theme repo. The idea being, you’d separate the theme from GitHub with the local master. Use branches in the local master to make changes to push back to GitHub and the main Roots repo or to pull down to your theme or both. Fetch updates from GitHub into local master so your baseline is current and then decide which changes to pull to your theme based on changes you’ve made in the theme (might not want to update app.less, for example).

If you’re developing a theme a week, it probably doesn’t matter much because Roots won’t change much in a week. If you’re taking a more leisurely approach, getting updates may be more valuable.

Someone will probably tell me why this is a bad idea.

The part that has me really confused now is the plugins and how the work within the WordPress-Skeleton structure. Also, what if a plugin changes something in the WordPress submodule? $ git status will then report changes in files not tracked…

Maybe this thread is headed in the direction of needing its own topic?

Thanks, @cfx for posting this video series- looks really helpful. There is hope for me yet! :wink:

Do you know if it is possible to use GitHub and BitBucket? I love the Windows GUI for GitHub but I also love the fact you can have unlimited private repos with BitBucket.

@jayseventwo - Your post made me smile. So glad I am not alone in this.

I run a small web agency, but basically I am the main developer- so I don’t need to share the code with anyone else. That’s why I haven’t really seen the need to use Git. However, I’ve found it useful for commenting code and keeping a backup. Once I get my head round branches and undoing changes I think I will finally see its powers. I do love Grunt- it works really well for Roots. I will have to have a play with the Less extension for Dreamweaver. Quite why Adobe don’t support LESS as standard I don’t know. However, I really want to move away from Dreamweaver and use a code editor like SublimeText or NotePad++. The thing I would miss is inbuilt FTP which, like you, I use within Dreamweaver.

I do love the idea of git-ftp which I looked at. However I haven’t got a clue how to set it up. I am wondering whether this is where Capistrano comes in. If I could have a way to push to my dev, staging or production sites it would be awesome.

@MintyBear - great article, thanks. This looks really helpful. Like you, I am waiting to see what Capistrano might do, but there are some interesting ideas in the article. How do use Grunt to push to staging and production servers?

I am still uploading via FTP to my development server (i.e. not testing locally).

@iagdotme, not sure what you mean by “use GitHub and BitBucket”. But what I’ve done is exactly what she’s done in the video: I cloned a GitHub repo into BitBucket, then in my local environment I clone the BitBucket repo, so now when I make changes I push those back to BitBucket and everything stays private. Of course you can always push back to GitHub if you want to make a GitHub repo (which I’ve done). In fact, you can feel free to use my repo which includes Mark Jaquith’s WordPress Skeleton (with WordPress as a submodule); I’ve added Roots as a submodule to my repo:

So you can just do:

git clone --recursive .

and that will get you up and running with WP and Roots 6.5.0 or you can do what she does in the vid which is to clone/fork my GitHub repo into your Bitbucket to keep your repo private (recommended).

Not sure how frequently I will update this repo but for now everything is current!

@iagdotme, the latest version of Dreamweaver (CC) does actually support LESS, but does not compile. This is where that plugin helps, although probably not required for Dreamweaver CC if you have grunt doing the compiling for you.

I found an interesting tutorial on using Bitbucket that goes through the basics:

Also, i believe that git bash (the command line client for Git) works with Bitbucket, so perhaps Git for Windows also does (someone please correct me if i’m wrong, as i haven’t had a chance to try it yet).

This looks to be a good a good ftp plugin for Grunt as it does incremental uploads.

Any Git “client” will work fine with Bitbucket or any other Git repository host. It’s simply just adding a remote source. You can have a repo with both GitHub and Bitbucket as remotes as well. Good for redundancy in case one goes down (which has been happening frequently with GitHub lately).

This thread has gotten a bit out of control so I’m going to close it. People are encouraged to create new more specific threads about anything talked about in here. And remember that in Discourse you can still click “Reply as a new topic” from any reply.