Introduction to Git

Sreedevi ValetiSreedevi Valeti
2 min read

gitcoverimage.png

  • What is Git?

  • Features of Git

  • Git workflow

  • Git Commands

What is Git?

Git is a free and open source distributed version control system used to handle very small to large projects efficiently. It is developed to co-ordinate the work among the developers. The version control allows us to track and work together with our team members at the same workspace.

Features of Git

  • Branching and Merging
  • Small and Fast
  • Distributed
  • Staging Area
  • Free and Open Source

Git Workflow

image.png

Git Commands

  • It is a good idea to introduce yourself to Git with your name and public email address before doing any operation. To configure username and email for git:
         $ git config --global user.name "Your Name Comes Here"
         $ git config --global user.email you@yourdomain.example.com
    
  • To initialize the working directory:

        $ git init
    
  • To add changed file of a working directory to the staging area:

        $ git add filename
    
  • To add all the changed files of a working directory to the staging area:

        $ git add .
    
  • To know the status of the changed files in the current working directory:

        $ git status
    
  • To commit the files from staging area to git repository:

         $ git commit -m "message for the commit"
    
  • To view the history of your changes:

        $ git log
    
  • To clone the copy of an existing repository into a new directory:

       $ git clone repo-url
    
  • A single Git repository can maintain multiple branches of development. To create a new branch named "development", use
      $ git branch development
    
  • To list the branches of a working directory:

     $ git branch
    
  • To push all local branch commits to the corresponding remote branch:

     $ git push
    
1
Subscribe to my newsletter

Read articles from Sreedevi Valeti directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Sreedevi Valeti
Sreedevi Valeti

I am a Tech Enthusiastic, working as a Cloud Engineer. I have expertise in Cloud Administration. Tech Stack: Multi-Cloud: AWS and AZURE Programming Languages: Python Infrastructure As Code: Terraform and Cloud Formation DevOps Tools: Git, GitHub, Docker, Code pipeline, Code Build, Code Deploy, Code Commit. OS: Linux Certifications : AWS Certified Solutions Architect Associate, AZ-900 For technical collaborations, you can drop a mail to sreedevi.devopscloud@gmail.com