Getting started with Git & GitHub for DevOps 🔧

High functional, goal-oriented, and result driven Analyst with 2+ years of progressive experience. contributing to organizational success through high-level strategy and the implementation of excellence. Strong track record of inspiring effective cross-functional collaboration and innovative problem solving skills.
Passionate about exploring the ever-evolving world of DevOps technology. On a journey to unlock the secrets of seamless development, continuous integration, and deployment.
Committed to continuous improvement and lifelong learning.
✏️Introduction
Do you ever wonder why we see the number in any software such as 6.4.21, 5.4.9..etc? This is called the version i.e. software versions. Why do we need versions in the software when we can simply release them? Let's understand the concept of Version in software development and release journey!
Git and GitHub are essential tools in the DevOps journey for version control, collaboration, and automated workflows. Git allows developers to track changes made to the source code over time which supports the version concept in software. And giving a platform to different developers to collaborate seamlessly on one platform.
📲 Understanding Version Control System (VCS):

The concept of a Version Control System (VCS) has come into the picture to overcome the demerits of FDS(file distributed system) and also to provide more wider platform for developers to collaborate on projects. It is necessary to keep track of the changes that have been made to the code. A version control system records all the history of a code base modification, including when a file was created and which lines were modified, when, and by whom. It does this by keeping track of all the changes made to the code base in one location. When we wish to return a file to a previous version, all of the modifications we have made to it are saved in this system as a version.
There are mainly two types of version control systems:
Centralized Version Control System (CVCS): The concept behind a centralized version control system, or CVCS, is to keep track of all project file versions on a single server. A developer must "check out" the files from the central server to make changes to the code base. Once the modifications are complete, the developer "checks in" the revised files to the central server. Perforce and Subversion are two instances of CVCS.
Distributed Version Control System (DVCS): Developers can clone a project and all of its version history onto their local PCs with a distributed version control system (DVCS). Developers can make any modifications they wish to the code base and then merge those changes into the main repository by cloning the entire source onto their computers. DVCS examples include Darcs, Mercurial, and Git.
♻️ Making a choice: DVCS Vs CVCS
Actions are primarily executed locally, resulting in faster processes.
Because the full repository is cloned locally, you can work without interruption.
Allows for improved collaboration, since every developer has a copy of the entire repository locally.
Boosts data security with every developer's machine serving as a backup.
Most actions, including commits and history browsing, are conducted locally, resulting in faster response times.
In this blog, we'll be more focused on the DVCS i.e. the most famous Git & GitHub.
🔑 Knowing Git
Git is an open-source, distributed version control system that is considered to be ideal for managing projects of any size swiftly and efficiently. It is designed to make life easier for developers by allowing them to keep track of and collaborate with their coworkers in the same workspace.
Developed by Linus Torvalds, the creator of Linux. Git's popularity stems from its ease of use and quick performance. A staging area is a feature included in Git that allows changes to be selectively prepared for commit. This allows developers to arrange and evaluate their modifications before adding them to the project's history.
🔶 Basic Git commands
git init: To establish a local git repository. This action generates a .git folder containing all the necessary files for managing file history. With this, version tracking officially begins.
git add: Incorporates the modifications made to the source code into a staging area. These changes can then be committed to the code.
git commit: Commits the updated code, and a commit message must accompany it. This message explains all the changes included in the commit. To provide the commit message, use the -m flag, like this: git commit -m.
git push: After creating a commit, we need to push the changes to an online repository, such as GitHub, so that the newly made updates are reflected in the repository and accessible to everyone.
💡 What is GitHub?
GitHub is a friendly online home or a website for your code. It's where you can store and manage your projects using Git. With its easy-to-use interface, GitHub makes handling your code a breeze. Plus, it's not just a platform; it's a massive community of coders from all around the globe, making it the go-to place for all things coding.
GitHub hosts Git repositories, allowing developers to store and manage their source code and making it easy for multiple developers to collaborate on a project. It provides a platform for communication and coordination.
📜 Conclusion
To sum up, Git and GitHub are essential resources and tools for DevOps professionals, including effective version control and teamwork features. These tools simplify both project management and software development, which makes them essential for DevOps professionals.
GitHub is a hub for open-source projects, facilitating collaboration with the broader development community. It's not just about the code, it's a place to share ideas and work together. which often includes Documentation, and READ-me doc, making it easy to share knowledge and best practices.



