0% found this document useful (0 votes)
67 views

GIT Notes

This document discusses top 10 reasons to learn DevOps. It explains that DevOps involves various stages of the software development lifecycle including source code management, continuous integration, testing, configuration management, and containerization. Mastering DevOps skills makes individuals more valuable and marketable to companies. It also allows for faster software releases, fewer failures, and fast career growth. The document then provides an overview of the distributed version control system Git, explaining its purpose, features, and how companies like Microsoft use it.

Uploaded by

Sastry C
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views

GIT Notes

This document discusses top 10 reasons to learn DevOps. It explains that DevOps involves various stages of the software development lifecycle including source code management, continuous integration, testing, configuration management, and containerization. Mastering DevOps skills makes individuals more valuable and marketable to companies. It also allows for faster software releases, fewer failures, and fast career growth. The document then provides an overview of the distributed version control system Git, explaining its purpose, features, and how companies like Microsoft use it.

Uploaded by

Sastry C
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

https://www.youtube.com/watch?

v=LIhE7L__E6M
Git Overview

Diff b/w Merge and Rebase


---
Top 10 Reasons To Learn DevOps:
Quite frequently I encounter this question, that why should I learn DevOps. This blog on
top 10 reasons to learn DevOps, is basically to tell you how important it is nowadays to
understand the concept of DevOps.

Below are 10 reasons to learn DevOps:

1. Anyone Can Learn DevOps


2. Fat Paycheck
3. Easy To Get A Job
4. Fast Career Growth
5. Fewer Software Failure
6. Faster Releases
7. Exposure To Various Trending Tools and Technologies
8. Separate Yourself From The Crowd
9. Become More Valuable To The Company
10. 360 Degree View Of The SDLC

Since DevOps involves various stages/ phases:

1. Source Code Management


2. Continuous Integration
3. Continuous Testing
4. Configuration Management
5. Contanerization
6. Continuous Monitoring

Once you are familiar with DevOps concepts, you get an idea about the entire software
delivery life-cycle (SDLC). As a developer you will have an idea what is happening in
testing and production, that goes for other profiles as well.

9. Become More Valuable To The Company:


Most of the companies for cost optimization purpose are looking for people with wide
variety of skills.

With DevOps you become more valuable to the company, since you know various tools
and technologies used for development, testing and deployment.

8. Separate Yourself From The Crowd:


With DevOps knowledge you can offer something unique to any organization. This gives
you an edge over other people in an interview.

7. Exposure To Various Trending Tools And


Technologies:
DevOps involves various phases, and for each phase there are multiple tools available.

Tools such as:

 Git
 Jenkins
 Selenium
 Docker
 Kubernetes
 Puppet
 Chef
 Ansible
 Nagios

6. Faster Releases:
DevOps makes the SDLC process really agile, this ensures in time releases.
Organizations can analyse user behaviour pretty quickly and incorporate those changes
in the next release. This gives the organizations an edge over it’s competitors, and
users get a better product.

This happens because of various phases involved in DevOps and multiple tools
available. This allows Continuous Delivery and sometimes even Continuous
Deployment.

At Amazon, engineers are deploying code every 11.7 seconds, on an average.

5. Fewer Software Failures:


For about 40 minutes in 2014, the entire state of Washington lost the ability to reach
help dialing 911, all because of one faulty line of code.

The major software failures now mean literal life or death. Other examples include
Toyota vehicle acceleration errors causing fatal accidents because of a software
malfunction and medical radiation therapy killing patients. This is scary stuff.

Developers didn’t seem to have empathy or awareness of what happened to their code
after it was passed to operations. And vice versa, the business was not including
developers enough in the bigger picture to help them focus their efforts. This problem
was identified some time ago. The solution to this problem was DevOps. DevOps
ensures that developers have an idea about all the other teams because of DevOps,
feedback is gives pretty early and chances of improving the code has exponentially
grown.

4. Fast Career Growth:


Up-scaling yourself is a necessity, especially nowadays when technology is evolving at
a rapid pace.

You have to become more valuable to the organization, that is where DevOps can play
a very vital role. It can increase your career growth.

You can become a Release Manager, Project Manager, Automation Architect or even
a DevOps Evangelist.

3. Easy To Get A Job:


There is a lot of demand of DevOps professionals, but currently there are not enough
people to meet the desired requirements for DevOps roles and responsibilities. This
leaves a huge window of opportunity for anyone seeking to make a mark for himself and
DevOps can be a good career opportunity for them

DevOps provides the benefits which we all need in today’s market and a person who is
good in that will certainly be very much in demand and will enjoy a fruitful career.

As per CIO insight, Companies can increase frequency of their deployment by 50% by
adopting to DevOps Practices also can save up to 46% in cost on other hand. There
has been an increase of 22% in customer base has also observed in some cases.

This increases your chance of getting hired easily, provided you have good hands-on
knowledge on various DevOps tools and technologies.

Notice that demand for DevOps professionals is increasing and will continue this way for quite
sometime

2. Fat Paycheck:
DevOps professionals are pretty highly paid across all geographies

1. Anyone Can Learn DevOps:


People from different backgrounds can learn DevOps. Even a fresher with basic
knowledge of Linux and one scripting language can learn DevOps.
GIT Overview
Git is a free, open source distributed version control system tool designed to handle
everything from small to very large projects with speed and efficiency. It was created by
Linus Torvalds in 2005 to develop Linux Kernel. Git has the functionality, performance,
security and flexibility that most teams and individual developers need. It also serves as
an important distributed version-control DevOps tool.

In this ‘What is Git’ blog, you will learn:

 Why Git came into existence?


 What is Git?
 Features of Git
 How Git plays a vital role in DevOps?
 How Microsoft and other companies are using Git

What is Git – Why Git Came Into Existence?


We all know “Necessity is the mother of all inventions”. And similarly Git was also
invented to fulfill certain necessities that the developers faced before Git.

What is the purpose of Git?


Git is primarily used to manage your project, comprising a set of code/text files
that may change.

There are two types of VCS:


 Centralized Version Control System (CVCS)
 Distributed Version Control System (DVCS)

Centralized VCS - Centralized version control system (CVCS) uses a central server to
store all files and enables team collaboration. It works on a single repository to which
users can directly access a central server.
Please refer to the diagram below to get a better idea of CVCS:
The repository in the above diagram indicates a central server that could be local or
remote which is directly connected to each of the programmer’s workstation.

Every programmer can extract or update their workstations with the data present in the
repository or can make changes to the data or commit in the repository. Every
operation is performed directly on the repository.

Even though it seems pretty convenient to maintain a single repository, it has some
major drawbacks. Some of them are:

 It is not locally available; meaning you always need to be connected to a network to


perform any action.
 Since everything is centralized, in any case of the central server getting crashed or
corrupted will result in losing the entire data of the project.

This is when Distributed VCS comes to the rescue.

Distributed VCS-These systems do not necessarily rely on a central server to store all
the versions of a project file.
In Distributed VCS, every contributor has a local copy or “clone” of the main repository
i.e. everyone maintains a local repository of their own which contains all the files and
metadata present in the main repository.

You will understand it better by referring to the diagram below:


As you can see in the above diagram, every programmer maintains a local repository on
its own, which is actually the copy or clone of the central repository on their hard drive.
They can commit and update their local repository without any interference.

They can update their local repositories with new data from the central server by an
operation called “pull” and affect changes to the main repository by an operation called
“push” from their local repository.

The act of cloning an entire repository into your workstation to get a local repository
gives you the following advantages:

 All operations (except push & pull) are very fast because the tool only needs to access
the hard drive, not a remote server. Hence, you do not always need an internet
connection.
 Committing new change-sets can be done locally without manipulating the data on the
main repository. Once you have a group of change-sets ready, you can push them all at
once.
 Since every contributor has a full copy of the project repository, they can share changes
with one another if they want to get some feedback before affecting changes in the main
repository.
 If the central server gets crashed at any point of time, the lost data can be easily
recovered from any one of the contributor’s local repositories.

What Is Git?
Git is a Distributed Version Control tool that supports distributed non-linear workflows by
providing data assurance for developing quality software. Before you go ahead, check
out this video on GIT which will give you better in-sight.

Git provides with all the Distributed VCS facilities to the user that was mentioned
earlier. Git repositories are very easy to find and access. You will know how flexible and
compatible Git is with your system when you go through the features mentioned below:

What is Git – Features Of Git

Free and open source:


Git is released under GPL’s (General Public License) open source license. You don’t
need to purchase Git. It is absolutely free. And since it is open source, you can modify
the source code as per your requirement.
Speed:
Since you do not have to connect to any network for performing all operations, it
completes all the tasks really fast. Performance tests done by Mozilla showed it was an
order of magnitude faster than other version control systems. Fetching version history
from a locally stored repository can be one hundred times faster than fetching it from the
remote server. The core part of Git is written in C, which avoids runtime overheads
associated with other high level languages.

Scalable:
Git is very scalable. So, if in future , the number of collaborators increase Git can easily
handle this change. Though Git represents an entire repository, the data stored on the
client’s side is very small as Git compresses all the huge data through a lossless
compression technique.

Reliable:
Since every contributor has its own local repository, on the events of a system crash,
the lost data can be recovered from any of the local repositories. You will always have a
backup of all your files.
Secure:
Git uses the SHA1 (Secure Hash Function) to name and identify objects within its
repository. Every file and commit is check-summed and retrieved by its checksum at the
time of checkout. The Git history is stored in such a way that the ID of a particular
version (a commit in Git terms) depends upon the complete development history
leading up to that commit. Once it is published, it is not possible to change the old
versions without it being noticed.

Economical:
In case of CVCS, the central server needs to be powerful enough to serve requests of
the entire team. For smaller teams, it is not an issue, but as the team size grows, the
hardware limitations of the server can be a performance bottleneck. In case of DVCS,
developers don’t interact with the server unless they need to push or pull changes. All
the heavy lifting happens on the client side, so the server hardware can be very simple
indeed.

Supports non-linear development:


Git supports rapid branching and merging, and includes specific tools for visualizing and
navigating a non-linear development history. A core assumption in Git is that a change
will be merged more often than it is written, as it is passed around various reviewers.
Branches in Git are very lightweight. A branch in Git is only a reference to a single
commit. With its parental commits, the full branch structure can be constructed.
Easy Branching:
Branch management with Git is very simple. It takes only few seconds to create, delete,
and merge branches. Feature branches provide an isolated environment for every
change to your codebase. When a developer wants to start working on something, no
matter how big or small, they create a new branch. This ensures that the master branch
always contains production-quality code.

Distributed development:
Git gives each developer a local copy of the entire development history, and changes
are copied from one such repository to another. These changes are imported as
additional development branches, and can be merged in the same way as a locally
developed branch.

Compatibility with existing systems or protocol


Repositories can be published via http, ftp or a Git protocol over either a plain socket, or
ssh. Git also has a Concurrent Version Systems (CVS) server emulation, which enables
the use of existing CVS clients and IDE plugins to access Git repositories. Apache
SubVersion (SVN) and SVK repositories can be used directly with Git-SVN.

What is Git – Role Of Git In DevOps?

Now that you know what is Git, you should know Git is an integral part of DevOps.
DevOps is the practice of bringing agility to the process of development and operations.
It’s an entirely new ideology that has swept IT organizations worldwide, boosting project
life-cycles and in turn increasing profits. DevOps promotes communication between
development engineers and operations, participating together in the entire service life-
cycle, from design through the development process to production support.

The diagram below depicts the Devops life cycle and displays how Git fits in Devops.

The diagram above shows the entire life cycle of Devops starting from planning the
project to its deployment and monitoring. Git plays a vital role when it comes to
managing the code that the collaborators contribute to the shared repository. This code
is then extracted for performing continuous integration to create a build and test it on the
test server and eventually deploy it on the production.

Tools like Git enable communication between the development and the operations
team. When you are developing a large project with a huge number of collaborators, it is
very important to have communication between the collaborators while making changes
in the project. Commit messages in Git play a very important role in communicating
among the team. The bits and pieces that we all deploy lies in the Version Control
system like Git. To succeed in DevOps, you need to have all of the communication in
Version Control. Hence, Git plays a vital role in succeeding at DevOps.

Who uses Git? – Popular Companies Using Git


Git has earned way more popularity compared to other version control tools available in
the market like Apache Subversion(SVN), Concurrent Version Systems(CVS), Mercurial
etc. You can compare the interest of Git by time with other version control tools with the
graph collected from Google Trends below:
In large companies, products are generally developed by developers located all around
the world. To enable communication among them, Git is the solution.

Some companies that use Git for version control are: Facebook, Yahoo, Zynga, Quora,
Twitter, eBay, Salesforce, Microsoft and many more.

Lately, all of Microsoft’s new development work has been in Git features. Microsoft is
migrating .NET and many of its open source projects on GitHub which are managed by
Git.

One of such projects is the LightGBM. It is a fast, distributed, high performance gradient
boosting framework based on decision tree algorithms which is used for ranking,
classification and many other machine learning tasks.

Here, Git plays an important role in managing this distributed version of LightGBM by
providing speed and accuracy.

At this point you know what is Git; now, let us learn to use commands and perform
operations in my next Git Tutorial blog.

Popular Question:
What is the difference between Git vs GitHub?
Git is just a version control system that manages and tracks changes to your source
code whereas GitHub is a cloud-based hosting platform that manages all your Git
repositories.

Why is Git so popular?


Git is a distributed version control system(VCS) that enables the developers to manage
the changes offline and allows you to branch and merge whenever required, giving
them full control over the local code base. It is fast and also suitable for handling
massive code bases scattered across multiple developers, which makes it the most
popular tool used.
What is Github?
GitHub is a highly used software that is typically used for version control. It is helpful when more
than just one person is working on a project. GitHub is a central repository and Git is a tool
which allows you to create a local repository. Now people usually get confused between git and
GitHub but its actually very different. Git is a version control tool that will allow you to perform all
kinds of operations to fetch data from the central server or push data to it whereas GitHub is a
core hosting platform for version control collaboration. GitHub is a company that allows you to
host a central repository in a remote server.

How to create a GitHub Repository?


Create Branches and Perform Operations
What is the difference between Git Shell and Git
Bash?
Git Bash and Git Shell are two different command line programs which allow you to
interact with the underlying Git program. Bash is a Linux-based command line while
Shell is a native Windows command line.

Initialize
In order to do that, we use the command git init. Please refer to the below screenshot.

git init creates an empty Git repository or re-initializes an existing one. It basically
creates a .git directory with sub directories and template files. Running a git init in an
existing repository will not overwrite things that are already there. It rather picks up the
newly added templates.

Chk commands Pending

You might also like