Version control systems allow users to track changes to files over time, enabling retrieval of specific file versions. Centralized systems store version history on a central server, while distributed systems give each user a local copy of the full version history. Key aspects of version control include keeping track of changes, reverting files to previous versions, and easily incorporating others' work. Popular systems include Git, a distributed version control system, and SVN, a centralized system. GitHub is a code hosting platform that utilizes Git for collaboration and version control through features like repositories, branches, commits, and pull requests.
2. VERSION
CONTROL
• Version control is a system that records changes to a file or set
of files over time so that you can recall specific versions later.
• If you are a graphic or web designer and want to keep every
version of an image or layout then it allows you to revert files
back to previous state revert the entire project back to
previous state, compare changes over time, see who last
modified something that might be causing a problem , who
introduce an issue and when, and more.
@2020 copyright KalKey training
3. Why Is Version
Control So
Important?
Keeping track of changes.
Ability to go back to a
previous working version.
Easily add someone else’s
work.
@2020 copyright KalKey training
4. TYPES OF VERSION CONTROL SYSTEM
Centralized
Version
Control System
Distributed
Version
Control System
@2020 copyright KalKey training
5. VCS
• Centralized Version control system
• Centralized version control means that the version history is stored in a central
server. When a developer wants to make changes to certain files, they pull files from
that central server to their own computer. After the developer has made changes,
they send the changed files back to the central server.
• Distributed Version control system
• Distributed VCS, everyone has a local copy of the entire work’s history This
means that it is not necessary to be online to change revisions or add changes to the
work.
• “Distributed” comes from the fact that there isn’t a central entity in charge of
the work’s history, so that anyone can sync with any other team member. This helps
avoid failure due to crash of the central versioning server.
@2020 copyright KalKey training
8. SVN
• SVN is a centralized version control system. ... Centralized version control means that the version history is
stored in a central server. When a developer wants to make changes to certain files, they pull files from
that central server to their own computer
@2020 copyright KalKey training
9. INTRODUCTION TO GIT
• Git is a distributed version-control system for tracking changes in source
code during software development.
• It is designed for coordinating work among programmers, but it can be
used to track changes in any set of files.
• Its goals include speed, data integrity and support for distributed, non-
linear workflows.
• Git is free and open-source software distributed under the terms of
the GNU General Public Licensee version 2.
@2020 copyright KalKey training
10. Installation Git on Windows
1. Download the git software from the following link.
https://git-scm.com/downloads
2. Now open the software, click next, and customize your
installation and finish it.
3. Check the git version from command prompt on your
system by executing the following command.
git --version // or you can type the same command by
opening git bash
4. Execute the below command for creating an empty Git
repository or reinitialize an existing one.
git init
@2020 copyright KalKey training
11. Installation Git on Linux
1. Install the git package by running the below command.
yum install git -y
3. Check the git version by executing the below command
from your linux instance.
git --version
4. Execute the below command for creating an empty Git
repository or reinitialize an existing one.
git init
5. Configure your Git username and email using the following
commands.
git config --global user.name “John”
git config --global user.email john.18@example.com
git config --list
@2020 copyright KalKey training
12. GIT - LIFE CYCLE
1
Clone the git
repository as a
working copy.
2
Modify the working
copy by adding/editing
files.
3
If necessary, also
update the working
copy by taking other
developer's changes.
4
Review the changes
before commit.
5
Commit changes. If
everything is fine, then
push the changes to
the repository.
6
After committing, if
something is wrong,
then correct the last
commit and push the
changes to the
repository.
@2020 copyright KalKey training
14. GITHUB
• GitHub is a code hosting platform for collaboration and version control.
• GitHub lets you (and others) work together on projects.
• GitHub essentials are:
Repositories
Branches
Commits
Pull Requests
Git (the version control software GitHub is built on)
@2020 copyright KalKey training
15. Repository
• A GitHub repository can be used to store a development project.
• It can contain folders and any type of files (HTML, CSS, JavaScript, Documents, Data, Images).
• A GitHub repository should also include a license file and a README file about the project.
• A GitHub repository can also be used to store ideas, or any resources that you want to share.
@2020 copyright KalKey training
16. Branch
• A GitHub branch is used to work with different versions of a repository at the same time.
• By default a repository has a master branch (a production branch).
• Any other branch is a copy of the master branch (as it was at a point in time).
• New Branches are for bug fixes and feature work separate from the master branch. When changes are
ready, they can be merged into the master branch. If you make changes to the master branch while
working on a new branch, these updates can be pulled in.
Commits
• At GitHub, changes are called commits.
• Each commit (change) has a description explaining why a change was made.
@2020 copyright KalKey training
17. Pull Requests
• Pull Requests are the heart of GitHub collaboration.
• With a pull request you are proposing that your changes should be merged (pulled in) with the master.
@2020 copyright KalKey training
19. To create a new repository
1. In the upper right corner, next to your avatar or identicon, click + and then select new
repository.
2. Name your repository hello-world1.
3. Write a short description.
4. Select Initialize this repository with a README.
@2020 copyright KalKey training
21. To create a new branch
1. Go to your new repository hello-world.
2. Click the drop down at the top of the file list that says branch: master.
3. Type a branch name, INB-1, into the new branch text box.
4. Select the blue Create branch box or hit “Enter” on your keyboard.
@2020 copyright KalKey training
23. Make and commit changes
• Click the readme.md file.
• Click the pencil icon in the upper right corner of the file view to edit.
• In the editor, write a bit about yourself.
• Write a commit message that describes your changes.
• Click Commit changes button.
• These changes will be made to just the README file on your INB-1 branch, so now this branch contains content that’s different from master.
@2020 copyright KalKey training
24. Open a Pull Request
• Nice edits! Now that you have changes in a branch off of master, you can open a pull request.
• Pull Requests are the heart of collaboration on GitHub. When you open a pull request, you’re proposing your changes and
requesting that someone review and pull in your contribution and merge them into their branch. Pull requests show diffs,
or differences, of the content from both branches. The changes, additions, and subtractions are shown in green and red.
• As soon as you make a commit, you can open a pull request and start a discussion, even before the code is finished.
• You can even open pull requests in your own repository and merge them yourself. It’s a great way to learn the GitHub
flow before working on larger projects.
• Open a Pull Request for changes to the README
• When you’re done with your message, click Create pull request!
@2020 copyright KalKey training
25. Merge your Pull Request
In this final step, it’s time to bring your changes together – merging your INB-1 branch into the
master branch.
1. Click the green Merge pull request button to merge the changes into master.
2. Click Confirm merge.
3. Go ahead and delete the branch, since its changes have been incorporated, with the Delete
branch button in the purple box.
@2020 copyright KalKey training