What is Git: Features, Command and Workflow in Git

Git is a DevOps tool used for source code management. It is a free and open-source version control system used to handle small to very large projects efficiently. Git is used to tracking changes in the source code, enabling multiple developers to work together on non-linear development. Linus Torvalds created Git in 2005 for the development of the Linux kernel.

Learn the basics of Git VCS and understand how to setup Git in your system with the Git Training Course. Check out the course now.

Before diving deep, let’s explain a scenario before Git:

  • Developers used to submit their codes to the central server without having copies of their own
  • Any changes made to the source code were unknown to the other developers
  • There was no communication between any of the developers


Now let’s look at the scenario after Git:

  • Every developer has an entire copy of the code on their local systems
  • Any changes made to the source code can be tracked by others
  • There is regular communication between the developers


Post Graduate Program in DevOps

Designed in collaboration with Caltech CTMEExplore Course
Post Graduate Program in DevOps

What is Git?

Git is a version control system used for tracking changes in computer files. It is generally used for source code management in software development.

  • Git is used to tracking changes in the source code
  • The distributed version control tool is used for source code management
  • It allows multiple developers to work together
  • It supports non-linear development through its thousands of parallel branches

Features of Git

  • Tracks history
  • Free and open source
  • Supports non-linear development
  • Creates backups
  • Scalable
  • Supports collaboration
  • Branching is easier
  • Distributed development


Git Workflow


The Git workflow is divided into three states:

  • Working directory - Modify files in your working directory
  • Staging area (Index) - Stage the files and add snapshots of them to your staging area
  • Git directory (Repository) - Perform a commit that stores the snapshots permanently to your Git directory. Checkout any existing version, make changes, stage them and commit.


Branch in Git

Branch in Git is used to keep your changes until they are ready. You can do your work on a branch while the main branch (master) remains stable. After you are done with your work, you can merge it with the main office.


The above diagram shows there is a master branch. There are two separate branches called “small feature” and “large feature.” Once you are finished working with the two separate branches, you can merge them and create a master branch. 

FREE GIT Training

Learn the basics of GITEnroll Now
FREE GIT Training

Commands in Git

  • Create Repositories
    git init
  • Make Changes
  • Parallel Development
  • Sync Repositories
    add origin


  • Check the version of Git.


  • Set up global config variables - If you are working with other developers, you need to know who is checking the code in and out, and to make the changes.



  • If in case you need help, use the following commands:


This will lead you to the Git help page on the browser, which will display the following:


DevOps Certification Training Course

Gain expertise in the top DevOps toolsExplore Course
DevOps Certification Training Course

This will lead you to the Git help page on the browser, which will display the following:


  • Create a “test” repository in the local system.


  • Move to the test repository.


  • Create a new git instance for a project.

new git

  • Create a text file called info.txt in the test folder; write something and save it.


  • Check the status of the repository.

  • Add the file you created to make a commit.


  • Commit those changes to the repository’s history with a short message.


Free Course: Introduction to DevOps Tools

Master the Fundamentals of DevOps ToolsEnroll Now
Free Course: Introduction to DevOps Tools

  • Make any necessary changes to the file and save.


  • Now that you’ve made changes to the file, you can compare the differences since your last commit. 


  • Add GitHub username to Git Configuration.


  • Create a remote repository.


  • Connect the local repository to your remote repository.


  • Push the file to the remote repository.


DevOps Engineer Master's Program

Bridge between software developers and operationsExplore Course
DevOps Engineer Master's Program

  • Refresh your repository page on GitHub. You will get your local file on your remote GitHub repository.


  • Create three more text files in the local repository - “info1.txt”, “info2.txt”, “info3.txt”.



  • Create a branch “first_branch” and merge it to the main (master) branch.


The above command creates a branch.


The above command switches to the new branch from the master branch.

The above command creates and adds “info3.txt” to the first_branch.


FREE DevOps Certification Training

Master in-demand DevOps tools and skillsEnroll for FREE
FREE DevOps Certification Training

  • Create a branch “first_branch” and merge it with the main (master) branch.


The above command makes a commit to the first_branch.


The above command shows that the new branch has access to all the files.


The above command shows that the master branch does not have an “info3.txt” file.

The above command is used to merge “first_branch” with the master branch. Now, the master branch has “info3.txt” file.


What is DevOps?

DevOps is a culture that allows the development and operations teams to work together. With this type of working environment, developers continuously develop and test codes, and there is continuous integration taking place throughout the lifecycle. The operations team continuously deploys the code to the production environment. DevOps allows for better collaboration, increased trust, and faster software releases. 


Now that we know what DevOps is, let's move on to the tools used in DevOps.

Learn the basics of Devops

Watch the beginner level video lessons for FREEGet Access Now
Learn the basics of Devops

Tools in DevOps


Subversion (SVN), TFS, and Git are source code management or software configuration management tools (SCM) used for both the planning and coding of the software.  


Subversion (SVN):

  • SVN is a centralized version control system
  • It is distributed under the open-source license
  • It allows you to recover older versions of your data or examine how your data changes


  • TFS is an application lifecycle management solution that tracks issues and manages documents 
  • It has an open-source license
  • It enables you to recover older versions of your data or examine how your data changes


  • Git is a distributed version control tool
  • It is distributed under the GNU license
  • Git is used for maintaining historical and current versions of source code, web pages, etc

Version Control System (VCS)

The diagram below shows there are three files in the local system. A snapshot of these files are stored in the remote repository as Version 1. 


The following diagram includes a few changes:


There have been some changes to file 2 and is updated to file 2.1. This change is stored as Version 2 in the repository. VCS enables you to track the history of a file collection. Each version captures a snapshot of the files at a certain point in time, and the VCS allows you to switch between these versions.

Centralized Version Control System


  • Uses a central server to store all the files
  • Every operation is performed directly on the repository
  • All the versions of the file are stored on the Central VCS server
  • In case the central server crashes, the entire data of the project will be lost. Hence, distributed VCS was introduced.

Distributed Version Control System

  • Every programmer has a copy of all the versions of the code on their local systems
  • Distributed VCS moves from the client-server approach of central VCS to a peer-to-peer approach
  • They can update their local repositories with new data from the central server and changes are reflected in the principal repository
  • Git is one such distributed VCS tool


Explore the opportunities of working with the latest DevOps tools such as Docker, Git, Jenkins, and more by choosing our DevOps Engineer Certification Course. Grab your seat fast by contacting our admission counselor TODAY!


I hope this blog helped you understand Git. You have learned all about before Git and after Git, what DevOps is and tools used in DevOps. You learned various essential topics, like version control systems, centralized version control systems, distributed version control systems, what exactly Git is, benefits of Git, Git workflow, branch in Git, commands in Git, and finally, you saw a demo on Git.

Git is just one tool used in DevOps. To get further training in Git, you can take up the Git Training Course or an elective course on it through Simplilearn’s DevOps Engineer Master’s Program. This comprehensive program provides you with all of the skills you’ll need and access to the most widely used DevOps tools through a combination of live, instructor-led classes, online self-paced learning, and hands-on projects. If you’re beginning or want to take your career to the next level, Simplilearn has something for all aspiring DevOps professionals. To learn more about what we’re up to, check out additional resources here.

About the Author

Sayeda Haifa PerveezSayeda Haifa Perveez

Haifa Perveez is passionate about learning new technologies and working on them. She is an engineer who loves to travel, read and write. She's always curious about things and very determined to track the latest technologies and the trends that they are creating for the future.

View More
  • Disclaimer
  • PMP, PMI, PMBOK, CAPM, PgMP, PfMP, ACP, PBA, RMP, SP, and OPM3 are registered marks of the Project Management Institute, Inc.