Automation, development, and deployment speed.
Static files (HTML, CSS, js, assets like images and icons) are served by the CDN In both cases – S3 one and self-hosted one.
Let’s say that you have a “landers” directory that you decide to use as a project and store on GitHub.
Think of a repository as a list of revisions of that project.
In the repository, you can store list of changes you made to files in your “landers” directory compared to the previous version that is stored on the GitHub.
Each time you change something (modify file(s), add file(s), remove file(s), rename file(s)) on your local machine you have a possibility to update it on GitHub.
Updating it on GitHub is made by your decision on which of your local new/removed/changed/renamed files from the “landers” directory should be added in the next revision (add & commit)
After you decide on changes you wish to store, you can update your revision list on GitHub (push)
This is where this tool kicks in, when you update your revision list (push changes to the repository) it detects it and automatically adjust your production server (server that you use to host your “landers” directory) with the newest changes.
To put it simply – this just removes a step where you need to connect to your server to download the most recent changes.
So in our case Updating the revision list = making all of the changes visible on your server instantly.
Let’s say that you add a new file named “test.html” with the short text “Hello STM!” to your “landers” directory.
You now decide to add it to the revision list (add & commit) and update it on GitHub (push).
When you execute the push command, your server will automatically detect it (if my script was installed and configured properly) and update files to the latest version.
In other words, you can now visit yourdomain.com/test.html to see the “Hello STM!” text.
No upload or manual connection is needed.
You would still need to manually clear CDN/CloudFlare cache in case of changing the file instead of adding a new one.
This is a way CDNs works, clearing CDN caches can also be automated but it is a bit harder to achieve.
Hope this makes sense.
Just to be clear: this was just a super-over-simplified explanation of a git basic functionalities, this is a bit more complex topic.
It’s getting more complicated when you dive deep into it branching, but it’s a part of git functionality that would never be utilized by any affiliate working alone.