Imagine that you have an application or a project folder. And you want to collaborate with other people on that project.
Or imagine that you have your application, and you uploaded some new code into your application. You added a new feature for example.
And now your application breaks.
Let’s say your application is not running anymore like it was before.
And you are like “Hey. I would really love it if I could go back in the past in that code base in which my application was running.”
“I wish there was some sort of way to you know take a picture of that codebase, and whenever I want that picture like that codebase as it was, during that time in the past, I could have that.”
So, basically saving the history of your project.
Like, let’s say, 1st July, your project looked like this. 2nd July, your project looked like this. 3rd July your project looked like this. Like some additional files, code changes etc.
You want to go back to what your project looked like on 1st July. You can do that.
You want to go back to what your project looked like on 2nd July, you can do that.
That is a use case that you can think of.
Another one can be, you are contributing to open source for example. Or, you and your friends are contributing to one project.
Now, imagine that, 100 people are contributing to just one folder. That is what happens to open source projects as well. There is one main folder, and so many people from around the world are contribute to that project.
Now, you might be wondering, “how do these people share their code?”
If you want to share a code in some open source project, you want to add your own functionality or share some changes you made, how can you do that?
We can do that through Git and GitHub. So Git and GitHub allows us to maintain this history of the project at what particular point of time, which person made which change, and where in the project.
Git helps us in doing that.
P.S. Get my 2 Hour Web Developer to learn how to think like a developer.