Imagine spending hours working on a project, making several changes, and suddenly discovering that one of those changes broke everything.
How can you recover a previous version?
This is exactly where Git becomes essential.
What is Git?
Git is a distributed version control system that allows developers and infrastructure professionals to track changes across files and projects.
It helps us record modifications, create branches, compare versions, and collaborate with other developers.
Essential Git commands
As I continue learning infrastructure and DevOps, I have been practicing some fundamental Git commands.
1. Check the current repository status
Shows which files have been modified, added, or are not yet tracked.
2. Stage your changes
Adds changes to the staging area before committing.
3. Create a commit
git commit -m "Update project documentation"
Records the staged changes in the repository history.
4. Review commit history
Displays a concise history of previous commits.
5. Push changes to a remote repository
Sends local commits to the remote main branch.
Why does Git matter in DevOps?
Git is not just for application source code.
In DevOps environments, it is also useful for managing:
- Infrastructure configuration files.
- CI/CD pipeline definitions.
For example, when using Terraform to provision AWS infrastructure, storing configuration files in Git allows teams to track changes and collaborate more effectively.
My advice for beginners
Create a small project and start using Git from day one.
Do not wait until you join a company to develop this habit.
I am applying this approach in my own DevOps learning lab, and I believe version control is one of the most valuable skills for building a strong technical foundation.
Do you use Git only for source code, or do you also use it to manage infrastructure and configuration files?
Let's share experiences!
Loading article