DevOps Classroom Series – 16/Sept/2020

Who uses Git?

  • Developers use git for code repo access
  • Testers use git for storing
    • Automation Scripts
    • TestCases
  • DevOps Engineers use git
    • as first step to trigger the DevOps line
    • To store the Scripts/IAC/CI CD Pipelines etc in Git.
    • Configure and manage git (may be)

Git Basics

  • Git Installation:
    1. Windows:

      • First Option: Directly Download and install git from here
      • Second Option: Install Chocolatey from here and relaunch powershell & execute
      choco install git -y
      # to update to new version
      choco upgrade git
      
    2. Mac:

      • If you install xcode or homebrew on machine git is automatically installed
    3. Linux

      • Git might be already installed. If not
      # redhat based
      sudo yum install git -y
      # ubuntu based
      sudo apt-get install git -y
      
  • Verify if the git is installed Preview
  • First time configuration
git config --global user.name "<your user name>"
git config --global user.email "<your email>"

Preview

  • Most version control systems use differences (delta’s) as shown in the below image Preview
  • Git thinks of data as a snapshot of the filesystem. Every time we make change and create a new version, Git takes a picture fo what all files look like at that moment. To be efficient, if the files are not changed, Git doesn’t store file again rather it links to previous identical files. Preview

Terms of Git

  • Repository:
    • General: Where we can store data and we can maintain versions of the data stored, Helps you retrieve any version of data stored.
    • So Git Repository should be where we store our code which has versions.
    • If the Repository is present in your system, we call it local repository and if its on remote locations we call it remote repositories.
    • Repositories are referred shortly as repos
  • Commits
  • Checkout
  • Version/Revision

Lets create a local repository and get a local repository

  • Creating a local empty repository using git
git init 

Preview

  • Get the local repository from some other remote repository
git clone <url of the remote repository>

Preview

Next Steps

  • Git Stages: Preview

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About learningthoughtsadmin