Web Engg
Web Engg
• It is a free, open-source version control system (VCS) that allows developers to store, track,
and manage code, originally designed to manage the development of the Linux kernel.
• Version control is a system that tracks changes to files over time, allowing you to:
• Restore previous versions of a file or entire project.
• Collaborate effectively without overwriting changes.
• Understand the evolution of a project.
>>Git is used because with this multiple developers can work on the same project without
overwriting each others changes. It also record every change with metadata, (author ,timestamp
,commit message) making it easy track who made the changes and why.
• It was created in 2005 by Linus Torvalds, the creator of Linux, Git has become the most
widely used version control system in the world
• Git is version history for code , it allows us to save the past version of our code , it works
like a safety net when we are developing software.
• Benefits:
>It works on a distributed architecture , it stores the entire repository, every user has a copy of repository.
Staging area:
This works like a middle ground between your working directory and the repository.
>This holds the files files or folder that are to be send to the next version.
Working area:
Working area or change ,this holds the changes made in the files of a particular version.
In git we call version as commit and commit history.
(Git is special as it monitors not the files but the changes that are made in the file)
GIT SETUP(WORKING OF GIT)
• For windows Git can run with PowerShell terminal , always be in the directory where
your git files are present. Also integrating with a code editor like vs code.
• Commands to be used :
>To setup git inside the folder we use git init, using this git will start tracking the changes the are
being made.
>git status command :This shows the changes made since the previous version.
>git add command is used to select the changes ,these changes will be shown in the next version as
they are part of staging area. When using git add ,it adds all the subfolders inside a folder as well.
We use git add {file name}, for sending a single file to staging area but to send all
files we use git add . ,the dot includes all files.
>As we know git is used to create version history and in terms of git we will use
the word commit or commit history. We use the command git commit –m
“message ”.
• GitHub is a web-based version control and collaboration platform for software developers. GitHub,
which is delivered through a software as a service (SaaS) business model, was started in 2008. It
was founded on Git, an open source code management system created by Linus Torvalds to make
software builds faster.
• Linus Torvalds is also the mind behind the development of the Linux Operating System.
• GitHub allows developers to change, adapt and improve software from its public repositories for
free as part of various paid plans. Each public and private repository contains all a project's files, as
well as each file's revision history. Repositories can have multiple collaborators and owners.
HOW DOES GITHUB WORK?
• GitHub facilitates social coding by providing a hosting service and web interface for the
Git code repository, as well as management tools for collaboration.
• The developer platform can be thought of as a social networking site for software
developers. Members can follow each other, rate each other's work, receive updates for
specific open source projects, and communicate publicly or privately.
TERMINOLOGIES USED BY GITHUB DEVELOPERS
• Fork.A fork, also known as a branch, is a repository that has been copied from one member's account to
another member's account. Forks and branches let a developer make modifications without affecting the
original code.
• Pull request. If a developer would like to share their modifications, they can send a pull request to the owner
of the original repository.
• Merge. If, after reviewing the modifications, the original owner would like to pull the modifications into the
repository, they can accept the modifications and merge them with the original repository.
• Push.This is the reverse of a pull -- a programmer sends code from a local copy to the online repository.
• Commit. A commit, or code revision, is an individual change to a file or set of files. By default, commits are
retained and interleaved onto the main project, or they can be combined into a simpler merge via commit
squashing. A unique ID is created when each commit is saved that lets collaborators keep a record of their
work. A commit can be thought of as a snapshot of a repository.
• Clone.A clone is a local copy of a repository.
BENEFITS AND FEATURES OF GITHUB