GIT Notes
GIT Notes
v=LIhE7L__E6M
Git Overview
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.
With DevOps you become more valuable to the company, since you know various tools
and technologies used for development, testing and deployment.
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.
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.
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.
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
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:
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.
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:
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.
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.
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.
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.
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.