Introduction to Git and GitHub: How are they different? What do they do?

Search for a command to run...

I found it on Reddit about six months ago. I don't know if I should put it here! 😅

That's a great analogy, Anna J McDougall.
Great read :)
Ten Crucial Tips for Seniors and Leads

As part of my training, I'm working on creating a smaller user microservice for a fake property website. After crafting the basic controller/service/repository and the testing alongside it, we were tasked with dockerising both the application and the...

I have been so excited to learn Docker. For so long, it's been a name floating around every tech space I've inhabited, but I haven't had the time to sit down and look into the details of what it is or how it works in a practical sense. Today, I took...

Today I announced my first official job as a developer after accepting a position as Junior Software Engineer with Novatec GmbH. I see this job as a long time coming, and the culmination of years of interest in technology and coding, but the truth is...

Follow Me on Twitter @AnnaJMcDougall One of the really cool things I'm discovering about NodeJS is that it allows us to interact more directly with computers, and enables the production of tools using the CLI (Command Line Interface: you may know it ...

What is the difference between Git and GitHub? Simply put, Git works on your local repository, and GitHub acts as cloud storage for the remote version of that repository. If you’ve ever used Dropbox or Google Drive on your desktop, phone, or tablet, you understand how a cloud-based system can back up your files. GitHub does a similar thing for Git repositories.
Already know the difference? Click here to get started tracking your project today with basic Git commands.
Git is a programme which allows you to track changes to files over time, without having to ‘Save As’ over and over again. You can access all different versions of those files for as long as you’ve been tracking them.
Consider your CV: most likely, you have played the ‘multiple versions’ CV game where you have to ‘Save As’ in Microsoft Word (or similar) with different names, over and over again, as you add different sections, make different versions, or simply update it with new information. Doing so can work if you’re strict about how you save and you’re only working with a minimal number of documents.
However, in the computing world, engineering teams are working on hundreds or thousands of documents for one project, and using ‘Save As’ is just not feasible. Eventually, someone will lose a file or someone will have to manually combine files that have different changes made, or even worse: you’ll accidentally use an old file because it’s not clear which one is the ‘main’ one or the most recent one. Git has been designed to solve this problem.
As you work on files and folders locally, when you’re happy with them you ‘commit’ them to Git: that is, save that as the latest version. Git then keeps a record of all the changes made in that folder: from renaming files to adding/deleting lines, and more. The sum of all these files, tracked changes, different versions, etc. is referred to as a Git repository. In general, you will have one repository per project.
GitHub is basically the online cloud/storage system for Git repositories. By linking up your local repository with an online (GitHub) repository, you can easily keep all versions of your project online. This not only provides you with a backup in case your local computer dies, but it also allows others to view and contribute to your code. Similarly, you can access thousands of other online repositories, view issues, and work on the code for them too.
Are changes made in Git automatically available on GitHub? No. There is a special procedure for downloading files/changes (known as ‘pulling’) and for uploading files/changes (known as ‘pushing’) to GitHub or any other remote or linked repository. Unlike some cloud storage systems such as Dropbox, which automatically updates itself as you change files, GitHub will only make changes in the cloud once they’re approved or pushed manually.
This week I’ll be adding a post covering the basic workflow of Git for your own project, based on your own computer. From there, I’ll be adding a few practice exercises so you can start using Git ASAP in your coding journey.
UPDATE: Basic Workflow Tutorial for Git/GitHub has now been posted! Check it out to get working with these two today.