O.K., so Git is a database. What does that really mean? How about a practical example?
Good questions. Let's get started ...
Suppose you've got some files (computer files of course) that you've been working on. They could be several files. They could be just one file. They could be a hundred and eighty seven files spread over 39 directories. They could be anything - computer programs, letters to your Mom, a training manual, or a web site full of hang glider pilot ratings. Regardless of what they represent to you, Git will see them as a collection of files to store in the database.
So you start out by telling Git to keep track of those files:
"Hey Git, keep track of these files for me."
"No, not those, just these 187 files in these 39 directories."
Well, you don't do it exactly like that, but that's the general idea.
So you go on and make some more changes and add some more files. Every once in a while you stop and tell Git:
"Hey Git, I changed these 8 files and added three more."
"Please keep a copy because I really like the way they are right now. Thanks."
And Git will do just that. It will keep adding changes to the database and give each new change a unique ID so you can get back to it later. You can add new files and folders. You can delete and rename things, and Git will keep track of it all. You can tell Git to "rewind the clock" to any point in time and Git will give you a copy of your files as they were when you saved them. It keeps all of that history in its database.
Now that's pretty cool so far, but the best part is yet to come. Not only can Git keep a database of your own changes, but Git can merge your changes with changes that other people make to their own databases. You just merge your databases together from time to time to keep in sync with what everyone else is contributing to your project.
The merging can be done "the old fashioned" way with a floppy disk (yes, my age is showing), or you can share databases over the interwebs. That's where sites like GitHub and GitLab come in. They are really just convenient places to share Git databases. You can share databases publicly with everyone in the world or just privately with a small group of people. You can even keep databases private for yourself. You can set up the databases so that some folks can see them but can't change them. You can give change permission to whoever you want so they can merge their changes into the shared version. You can even make separate "branches" for various versions, degrees of completion, and stages of approval.