Basic Git & GitHub for DevOps Engineers.

Basic Git & GitHub for DevOps Engineers.

In today's lesson, we will dive into the fundamental concepts of Git and GitHub, two essential tools for version control and collaboration. Whether you're a developer or a DevOps engineer, understanding Git and GitHub is crucial for efficient code management and project collaboration.

What is Git?

Git stands as a distributed version control system, enabling you to monitor alterations in files and synchronize collaborative efforts among multiple individuals. It serves as an indispensable tool for software development but finds utility in overseeing modifications to various sets of files. Through Git, you can:

  • Maintain a comprehensive log of contributors and their edits to specific sections of a file.

  • Easily revert to previous file versions when necessary.

  • Foster efficient collaboration by seamlessly sharing and merging changes into a unified version.

What is GitHub?

GitHub is an online platform that offers Git-based version control hosting services. It enhances Git's capabilities by incorporating functions such as issue tracking, pull requests, and collaborative utilities. GitHub enjoys widespread popularity among developers for project sharing and collaboration and is a frequent choice for hosting open-source projects.

What is Version Control?

Version control is a system that monitors file alterations over time, enabling you to retrieve specific versions, roll back files to earlier states, compare changes, identify contributors, and more. There are two primary categories of version control systems

1. Centralized Version Control Systems (CVCS): In CVCS, all project file versions are housed on a central server. Developers check out files, make modifications, and subsequently check them back in. Notable examples encompass Subversion and Perforce.

2. Distributed Version Control Systems (DVCS): DVCS empowers developers to clone the entire repository, encompassing the full version history. This affords them a comprehensive local replica of the repository, encompassing all branches and historical iterations. Prominent examples encompass Git, Mercurial, and Darcs.

Why Choose Distributed Version Control Over Centralized Version Control?

DevOps engineers often opt for DVCS solutions like Git over CVCS for various compelling reasons:

  1. Enhanced Collaboration: In DVCS, every developer possesses a complete repository copy, facilitating collaboration without continual reliance on a central server for communication.

  2. Accelerated Operations: DVCS expedites commits and version control activities by eliminating the need for constant interaction with a central server.

  3. Augmented Flexibility: Developers can operate offline and selectively share changes, avoiding the necessity to push all alterations to a central server.

  4. Heightened Security: DVCS's decentralized structure safeguards repository history by storing it on multiple servers, enhancing resilience against data loss.

As part of the task will perform below activity.

1. Create a new repository on GitHub and clone it to your local machine. You can do this through the GitHub web interface or by running the following command in your terminal:

git clone <repository-url>

2. Make some changes to a file in the repository and commit them to the repository using Git. Use the following commands:

git add <filename>

git commit -m "Your commit message"

3. Push the changes back to the repository on GitHub:

git push origin master

Verrify the changes in github repository.

Thanks,

Kishor Chavan