Version Control Basics0:06
Probably the first thing that we need to talk about in the world of software development is the idea of version control. It's also called source control or source code control. It doesn't matter what it's called. It's all the same. It allows us to track changes to our source code, and there are many different kinds of version control, but the defacto standard is called git. Our project, or at least the files within our project, live inside of a big folder called a repository.
Commits as Snapshots0:29
Our project, or at least the files within our project, live inside of a big folder called a repository. And as you are making changes to your source code, you can commit those changes. You are essentially creating a snapshot. In fact, one of the ways that I like to think about my project's source code is that it's a story because our source code evolves over time. I can see the story of how I have developed my applications and source control allows us to do that.
I can see the story of how I have developed my applications and source control allows us to do that because every commit that we make is a snapshot. So if I need to refer back to a prior snapshot just to see what the code was before I can do that. I can also compare different snapshots to see directly the differences between those. It's really a fantastic thing, but let's say that's okay. You need to do something a little risky. Maybe you need to implement a a fairly complex feature.
Using Branches Safely1:25
You need to do something a little risky. Maybe you need to implement a a fairly complex feature or maybe you just need to experiment. Now of course you don't want to do that with the master copy of your source code that's just asking for problems. But git has a feature called a branch. You can branch or create a branch of your master copy allowing you to essentially make whatever changes that you need to without harming or making any changes to your master copy.
that you need to without harming or making any changes to your master copy. And whenever you are happy with all of your changes, you can then merge those changes back into the master copy. Or if you just want to get rid of that branch completely, then you can do that as well. The idea though is that it protects your master copy and all of those things are wonderful. I mean, using git just for yourself on your own projects is a
Team Collaboration Workflow2:15
I mean, using GI just for yourself on your own projects is a fantastic thing to do. But GI or version control really shines when you work with a team because then each person on your team is working with their own cloned copy of that repository and then they can push their changes to the master repository. And if there are any conflicts, which there almost certainly is,
And if there are any conflicts, which there almost certainly is, whenever you work within the team, get, allows you to essentially manage those conflicts. So whether if you are fixing bugs, adding new features, or maybe you're just experimenting, version control gives you the ability to keep your projects source code safe, collaborative, and organized.
and organized.
