Watch on YouTubePlayPlays from YouTube. Google's privacy policy (opens in a new tab) applies.
Adam explains the difference between Git and GitHub, then walks through commits, pushes, branches and pull requests using Figma analogies like version history and duplicating a page.
What you'll learn
- Git tracks every change in a project folder, locally on your Mac.
- GitHub puts that folder online for others to download and contribute to; repos can be private or public.
- Git and GitHub help engineers resolve conflicts when they edit the same lines.
- A commit is a labelled snapshot of the entire folder (not one file or layer), like a manual version in Figma's version history.
- A commit stays on your computer until you push it to the origin repo.
- A branch lets you build on a fixed snapshot without chasing changes others make on
main; new features and fixes almost always start with one. - A pull request summarises the changes, invites review from people or AI agents, and once accepted merges the branch into
main.
Chapters
- 00:00Git versus GitHub
- 02:15Commits and pushes
- 05:29Branches, like duplicating a page
- 08:02Pull requests and merging
- 00:01Welcome back to this new module.
- 00:03In this module, we're going to unpack what it means to work with Git, what is Git, what is GitHub, and how we can actually make use of it in
- 00:13our daily workflow. So this is going to be more of a theoretical lessons lesson, but like I really encourage you to stick around because even though you might have
- 00:21heard about like Git pulls, Git commits, Git pushes, I really hope this video is going to let the connects in your head sort of connect.
- 00:30And let's start by unpacking the difference between what is a Git and what is a GitHub because you might have heard both terms and they are not necessarily the
- 00:38exact same thing, although one sort of builds on top of another.
- 00:41Let's start with Git.
- 00:43So Git is that original versioning system.
- 00:47Basically, imagine you have a folder on your Mac and each file or each change that you make to any of the files in that folder can be now Git
- 00:56tracked. So we can like track of like keep track of all of the changes that are happening.
- 01:01Every time you delete a file, you change a line of text in one of the file or create a new file, you can like have these changes like version
- 01:09in a way that allows you to really quickly go back and like see exactly what's been happening.
- 01:14But this is only happening locally on your Mac on your folder.
- 01:19So what GitHub does is it allows you to have your Git repository, so that folder which is Git tracked, and have it pushed online for others to see and
- 01:29use as well to help you contribute to the exact same folder.
- 01:33And GitHub is amazing because like with big code repositories, it might be very easy for engineers to step on each other's toes and like keep editing the same files.
- 01:44And what Git and GitHub does, it like it does a really good job at helping engineers resolve conflicts if they appear.
- 01:52So engineers like editing the same line of code in the same file.
- 01:58And yeah, it like first foremost, what GitHub does, it takes that folder of yours and it like makes it available for others out there online to like download onto
- 02:08their computer. Only if you want to, of course.
- 02:10You can have private and and public GitHub repositories.
- 02:13We'll get into that in a second.
- 02:15Um now with the difference between Git and GitHub out of the way, let's talk about the basic key concepts in working with Git.
- 02:25So at the end of the previous module, we did our initial commit.
- 02:30So we did like we basically have taken all of our work, all of the changes we did, like the refinements or work on the mobile, and we have squashed
- 02:39them into one initial commit.
- 02:42But if we were to like do proper commit work from the very beginning, our Git history would probably look something like this.
- 02:51So I have at this timeline with the most recent thing being listed at the top.
- 02:54Now each dot here in this timeline is one commit.
- 02:58So a commit is basically that snapshot in a version history.
- 03:03It's not that like, you know, each commit can only have one file or one change.
- 03:07Quite the contrary actually.
- 03:09You can have multiple file edits and differences or deletions or like new files be stored under one single commit, which then you can like add a label to this
- 03:20commit, add a little bit of a description so that it's easier for you to later on track it down and undo if you want or take out or reorder
- 03:29if that is something you need for for some reason.
- 03:33So when you when when I'm describing this concept, it may actually sound familiar.
- 03:37So in Figma, there is also a versioning system.
- 03:41I'm not sure if that was ever like really used that often.
- 03:44I guess maybe for folks working on design systems or really large elaborate files, that was handy.
- 03:50But yeah, there is a versioning system and it works automatically.
- 03:53Figma is going to be like creating snapshots for you on like without you ever noticing.
- 04:00And it allows you to like preview the snapshot, duplicate it, or restore your file into that version.
- 04:07But then you can totally create your own snapshots, and this is exactly what commits are.
- 04:13Uh notice how I'm creating a snapshot on this entire like the entire version of this file, right?
- 04:19So it's not that I'm creating a snapshot on change that I made on one particular frame or one particular layer or component.
- 04:26A snapshot is something that is um that encompasses the entire file, and the same is true with commits in your git tracked folder.
- 04:35One commit is going to basically like take a look at what's what has changed in your entire folder, and it's going to save that as a snapshot.
- 04:42Um then we have a concept of doing git push.
- 04:47So a commit like the first time you make it, it's only local to your computer, meaning nobody else on GitHub is going to see it.
- 04:56Uh if you want to make that commit or a set of commits available to other people, you would have to do what's called git push.
- 05:03So basically taking your commits and then pushing them to the origin repo.
- 05:08So origin mean that you know original repository in the clouds so so to speak.
- 05:13Um so that's this is why we do git push, right?
- 05:16Git commit, git push they often times this is often time something we would do right like like in combination I guess.
- 05:25Um then we have the concept of branching, branches.
- 05:30So um it might be familiar or it might sound familiar.
- 05:34Let's say I'm working on this Figma file, and I have this wild exploration in mind that I want to just try it out.
- 05:41So rather than changing like this entire file um ooh look at that.
- 05:493D in Figma, that's so cool.
- 05:51About time. Okay, I don't want to get too distracted by that.
- 05:56So let's say I want to I want to do this like wild creative exploration.
- 06:00What I would do often times I would just duplicate this page, maybe call it uh temporary exploration.
- 06:06Maybe that's not a temporary exploration, maybe that's just an exploration.
- 06:10Um, I would do make some changes here, and only if I like them, I would come back here and probably like I don't know, either just copy and paste
- 06:18layers from like this page back to this page, or sometimes even recreate everything again from scratch, but this time on that live version of the design.
- 06:28Others would maybe duplicate a file here.
- 06:31That's totally also an option.
- 06:33So a branch in Git is sort of a similar concept.
- 06:38So you create basically you choose a snapshot in your timeline, and you decide, okay, I want to create a branch from here.
- 06:46So even though other people might be still making changes to that main branch of our Git repository, and they might be pushing these changes, uh having a local branch
- 06:56makes sure that your code or like your building on top of that like very specific snapshots, and it's not that like you need to be constantly chasing all of
- 07:05the changes that are happening alongside in real time on that main branch.
- 07:10Gives you that peace of mind.
- 07:11And so when you're on the branch, you can make like keep making comments on that specific branch separately.
- 07:18And branch is something you would often time do whenever you want to start working on a new fix or a new feature or really anything.
- 07:25It almost always starts with a branch.
- 07:28That is like a really good idea to do.
- 07:30And we are going to be working on adding that my bookings view in this module.
- 07:35And yes, we are going to start things off by creating a separate branch for this work to be tracked in.
- 07:41We're going to make a couple of comments.
- 07:43We're going to then test this implementation, and once it's looking good, we will want to merge this branch again back with the main branch so that it becomes part
- 07:53of the like the live breathing application.
- 07:56And the way for us to do so is by using GitHub's own concept, which is called a pull request.
- 08:04So a pull request like sure, we could have just merged one branch with another uh without like doing anything, but that is not really considered a good practice when
- 08:14you're working with other engineers on the same code repository.
- 08:19The reason pull requests are so great is because they create a summary of you know okay what is what are these changes about?
- 08:26Here are the files that have been affected or that are changed in this particular branch and it allows or creates opportunity for other engineers or AI agents these days
- 08:37to review this like work like by just looking on the things that have changed, provide you uh with the feedback or what's called a code review which you can
- 08:46then later address or ignore and then only once everyone in the team is happy about like this the shape of your branch that pull requests can be uh accepted
- 08:58which means merging your branch or commits in your branch with that main branch.
- 09:03Um and that is really the these are the most important like um fundamentals about uh working with Git.
- 09:13Over the course of the next couple of videos we are going to set up a GitHub account, we are going to push our local repository to GitHub and then
- 09:21we are going to start working on the My Bookings view while keeping track of uh what is happening with Git and we'll also get to uh see how it
- 09:32looks how it all looks like in practice.
- 09:35So thank you and I'll see you in the next video.