Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Shiyang Lin
Shiyang Lin
2,599 Points

Local Development - what to do when moving between laptops?

I am currently learning Wordpress development. As the course program goes, I am trained to develop it locally, then FTP it to the live website when I am done. Of course, all the data is stored on my laptop in the meantime.

What happens if I want to develop it on another laptop and start working on it again? I have multiple PC and Apple machines and I switch between them from time to time. For most of the work I have been doing before learning programming, I can simply pick up where I left off (Excel/Word/Emails etc.) because of Google Drive/Dropbox.

How can I do the same with web development?

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! It sounds like what you need is a "version control system". Besides being great at keeping track of when you change something in your code and why you changed it, it can allow multiple people to work on the same project at once without stepping on each other's code. This includes yourself working on multiple systems. Not only would I recommend this for Wordpress development but any programming you plan to take up in the future. I don't generally recommend that someone stop in the middle of something to go take another course, but I would highly recommend taking these courses ASAP so that you can stay synced across multiple devices.

Git Basics

GitHub Basics

Sharing Your Projects with GitHub Desktop

If you want access to your code and its history anytime from anywhere, this is your solution!

Hope this helps! :sparkles:

Shiyang Lin
Shiyang Lin
2,599 Points

Thank you Jennifer.

Do each of them have a unique purpose (Microsoft Word vs Excel), or do they all pretty much do the same thing (e.g. like Google Drive vs Dropbox)?

If it is the former, which one of them should I focus on first: Git, Github or Github Desktop?

Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Shiyang Lin they're all sort of integrated in a way. Git is a command line tool and a versioning system. I could try and explain it here, but honestly, you'd be best served to watch the videos about what it is. Imagine that you're writing your code for your site, but you want to experiment with a new feature. Now, you could do this by copying your code as it is now into a new folder and make an entirely new copy while retaining the old copy and see if it works. But imagine if you did that for every idea you had? Now expand that to include other members and their ideas with their code on their systems. This could include things that didn't work that you might want to try again but in a different way? Git maintains different versions of your code and when you get something ready and it works you can "merge" it with your "master" version. Whenever you make significant changes you can add a note saying what that change does and there will be a history and timeline with it and a snapshot of your code as it was then. This means that you can essentially go back in time and put your code back in a state where it was before a certain date or certain upgrade.

Once you get a handle on what Git is capable of and why it's really a brilliant solution for just this sort of thing, then move on to GitHub. GitHub is a free service which hosts your code in a cloud type environment. When you make significant changes you can "push" them up to GitHub where they're saved. The second video will teach you how to use GitHub so that you can use the things I described in the first paragraph from pretty much anywhere. This is what makes team collaboration on a project involving code possible. Each member can update the "main" version with what's in the cloud and then work on their feature/addition/bug fix separately. When it's done they can request it be merged in with the main or "master" version.

The final video is about GitHub Desktop which is essentially a GUI for the git command line tool and can make things a bit easier than memorizing a ton of command lines.

This is a very short explanation and not very thorough at all. Git is a powerful tool and GitHub is the place where you store your code off your system and it uses Git. The GitHub Desktop isn't absolutely required, but can make learning git a bit smoother in the start, and I highly recommend it.

Hope this helps! :sparkles:

Great suggestion! I also suggest Local By Flywheel as a MAMP/XAMPP replacement for Local Dev, super quick spin up - easy to work on many sites simultaneously - etc. Big A-ha for me finding this gem. Hope it helps!