Day 8 Task: Basic Git & GitHub for DevOps Engineers.

Day 8 Task: Basic Git & GitHub for DevOps Engineers.

What is Git?

Git is a distributed version control system that allows multiple people to collaborate on projects and keep track of changes to their code. It helps in managing different versions of files, tracking modifications, and enabling teamwork without conflicts. With Git, you can easily undo changes, work on different features simultaneously, and merge contributions from multiple contributors. It's widely used in software development for efficient and organized project management.

What is Github?

GitHub is like a virtual space on the internet where people can save and manage their computer code. It helps teams of developers work together on projects by keeping track of changes, coordinating efforts, and providing a platform for sharing and collaborating on code. Think of it as a shared workspace for coding projects.

What is Version Control? How many types of version controls we have?

Version control, also known as source control or revision control, is a system that records changes to a file or a set of files over time so that you can recall specific versions later. It allows multiple contributors to work on a project simultaneously without interfering with each other. The primary goals of version control are to track changes, facilitate collaboration, and provide a history of project development.

Key features of version control include:

  1. History Tracking: Version control systems (VCS) keep a detailed record of every change made to the project, including who made the change, when it was made, and what exactly was changed.

  2. Collaboration: Multiple developers can work on the same project concurrently. Version control helps manage conflicts and merge changes made by different team members.

  3. Branching and Merging: Developers can create branches to work on specific features or fixes independently. Later, these branches can be merged back into the main codebase.

  4. Backup and Recovery: Version control provides a safety net by keeping a complete history of the project. In case of errors or mistakes, you can revert to a previous state.

Types of Version Control Systems:

There are two main types of version control systems:

  1. Centralized Version Control System (CVCS):

    • In a CVCS, a central server stores the complete history of the project. Developers check out the latest version, make changes, and then commit those changes back to the central repository.

    • Examples of CVCS include CVS (Concurrent Versions System) and Subversion (SVN).

  2. Distributed Version Control System (DVCS):

    • In a DVCS, each developer has a local copy of the entire project, including its complete history. This allows developers to work independently without requiring constant access to a central server.

    • Examples of DVCS include Git and Mercurial.

Commonly Used Version Control Systems:

  • Git: Widely adopted for its speed and flexibility, Git is a distributed version control system used by many open-source and private projects.

  • Subversion (SVN): A centralized version control system that tracks changes to files and directories over time.

  • Mercurial: Another distributed version control system that focuses on simplicity and ease of use.

  • ✨Task:

  • Install Git on your computer (if it is not already installed). You can download it from the official website atgit-scm.com/downloads

  • I have installed Git on my laptop and screenshot below.

  • Create a free account on GitHub (if you don't already have one). You can sign up at github.com)

    1. Go toGoogle and search github.com

    2. github.comis open.

    3. Click on signup and enter your email then continue.

    4. You have to create the password and then continue

    5. Enter your unique username then continue.

    6. Choose a Plan.

    7. Verify Your Email.

    8. Complete the Setup.

    9. Explore GitHub.

      ✨Exercise:

      📌Create a new repositoryon GitHub and clone it to your local machine.

    10. Create a new repositoryon GitHub

  • clone it to your local machine.

📌Make some changes to a file in the repository and commit them to the repository using Git.

  • 📌Push the changes back to the repository on GitHub

  • Thank you for reading my blog. Don't forget to follow, comment and like my blog.

Did you find this article valuable?

Support Zehra Jabeen's Blog by becoming a sponsor. Any amount is appreciated!