(TWN) DevOps Prerequisite: Git Fundamentals
Git is one of the most important piece of technology for DevOps. It is what enables the Continuous integration (CI) in the CI/CD pipeline of DevOps.
Ultimately, Git, CI/CD, DevOps all exist for one thing: SDLC (Software Delivery Life Cycle).How can we bring the software or the digital solution to the customer faster and more efficiently? And how can we ensure the reliability of the solution? SDLC is a topic that deserves its own article, in this article we will look into:
What is Git? What is version control? Why is git important? What are the git commands?
What is Git?
Git is a distributed version control system designed to track changes in source code during software development with speed and data integrity. It allows developers and developer teams to collaborate, contribute and merge their codes seamlessly.
What is Version Control?
Version control is the practice of managing and tracking changes to software code over time. It acts as a historical ledger for a project, recording every modification made to the codebase.
Who made what changes? why did they do it?
Git is system for version control. Popular solutions such as Github and Gitlab are used by companies to allow collaboration between their developer and deliver reliable solutions.
Why is Git (or Version control) necessary?
Without Git or a tool for verison control, managing a software developing project through the different stages would be a chaos.
Just imagine on how people can collaborate? What happens when two different developers have made some changes to the code? How do they merge it? What happens if the new update breaks the system.
Git allows for the frequent merging of codes into a central repository. (Continuous integration)
By using version control, teams can ensure that the code is always in a "deployable" state. It provides the necessary triggers for CI/CD pipelines; as soon as a developer commits code, the pipeline automatically recognizes the change and begins the process of verifying the new code.
So, what are the best practices for Git?
1. Commit often, commit small
2. Write meaningful commit messages
3. Use a consistent branching strategy
4. Pull frequently
5. Use gitignore
6. Review code via pull requests
7. Tag your releases
Deep Dive into Git in SDLC
In a professional software development life cycle, Git serves as the "transportation system" that moves code through various stages of testing and validation before it reaches the end user. Each environment represents a different level of stability and purpose.
Local (Feature Branch)→SIT (Develop Branch)→UAT (Release Branch)→Prod (Main Branch)
In the professional world, developers will write and test their code in isolation without affecting the rest of the team. (Local Environment). And then combine code from multiple developers to ensure that the different parts of the system work well together in the SIT environment (System Integration Testing). Then, they test their development in a mirror environment as the production (User Acceptance Testing (UAT)) that is used by the stakeholders and QA testers to verify their software before going into production.
Is it amazing?
All the digital product and system that enable our world today go through this process. Our seamless interaction with digital products such as social media (Instagram) or banking tools is enabled by a team who is working in the backend.
And Git is a key enabler of this process.
In Conclusion:
Using Git provides two massive benefits to the SDLC
1. Traceability
Git alows us to look at the main branch and know exactly what is in production, or look at develop to see what is coming next.
2. Emergency Rollbacks
With Git, if a bug is found in Prod, you can quickly look at the Git history, find the previous stable tag, and redeploy that specific version in minutes, bypassing the need to "fix" the broken code under pressure.
Comments
Post a Comment