Sie sind auf Seite 1von 21

Introduction

to Version
Control with Git and
TAN TIEN PING
Background
A version control system (VCS) is a tool that manages and tracks a software, documents, and
data is called a.
VCS is very important especially in open source software development as most developer often
work independently at different modules or issues and they have to submit the update/changes
independently.
There are many VCS available. The most popular is Git.
Git was first introduced by Linus Torvalds to support the development of Linux kernel, but now it
has been expanded to support other software development, other OS (e.g. Windows), and it can
also be used to keep documents and data.
VCS Requirements
Why Git is introduced? Existing VCS that time does not meet the needs of Linux development.
Allow parallel, independent and simultaneous development in private repositories without constant
synchronization with central repository.
Able to handle large number of developers at a time.
Quick and efficient.
Maintain integrity and thrust. Data is not compromised during transfer, and in the central repository.
Enforce accountability. Keep track of who did what changes.
Immutability or cannot be modified once created.
Atomic transaction. A transaction that is performed or not at all.
Support and encourage branch development and merging.
Complete repositories.
Clean design.
Free & Freedom.
Previous VCS
The Source Code Control System (SCCS) was introduced in 1970s on Unix. The earliest VCS. It
introduced the concept of repository. User has to unlock a file and lock it back after update.
The Revision Control System (RCS) was introduced in 1980s on Unix. Introduced the concept of
forward delta and reverse delta concept.
The Concurrent Version System (CVS) was introduced in 1986 on Unix. De facto standard for
open source development for a long time. CVS allows a file to be independently modified at
private repository and then merged.
BitKeeper was available in 2000. It eliminates central repository and use a distributed one
instead. BitKeeper VCS commercial system, used for Linux kernel development in 2002. In
2005, BitKeeper ends support for free use version1.

Note: 1 BitKeeper turns open source in 2016.


Birth of Git
Git was introduced in 2005 due to the limitations of existing VCS.
The first Linux kernel (Linux-2.6.12-rc2) commit by Linus.
GitHub
GitHub is a Internet hosting service for Git repositories.
GitHub was launched in 2008.
GitHub can be manipulated using the Git command, or directly using online tool on the website.
Ref Wikipedia: As of April 2017, GitHub reports having almost 20 million users and 57 million
repositories,[6] making it the largest host of source code in the world.

You can see GitHub as it acts as a central and remote repository that stores Git projects.
Nevertheless, the Git command can work without using GitHub, as the command on one machine can
work with other Git repositories in different machines, because it is a distributed/peer to peer version
control system.
GitHub can be used to promote, and share an open source project.
Projects in Github

https://github.com/showcases
Projects in Github
Projects in Github
Projects in Github
Installation & Commands
Installing Git
If you are just interested in the latest version of a particular project from Github, you may go to the
project site and download. However, it is good to install git and download using git.

Ubuntu
$ sudo apt-get install git
Fedora
$ sudo yum install git

Mac: Come with Mac OSX XCode by default

Windows:
download the installer from https://git-for-windows.github.io/ and run it. Or
Use cygwin (Linux simulator)
Commonly Used Git Command
Setting Up a GitHub and Git Repository
1. Sign up an account an account
at GitHub.
2. First create a remote repository at GitHub.
3. Setting up the repository.
4. Voila!
5. Download the content of the remote repository to a local repository using git clone command.

6. Let see the content of the local directory that we have clone/ imported
Note: some
commands maybe
different in Windows

Hidden directory contains the setting and configuration.


7. Let say, we create a new file index.html

8. Add the index.html file to your Git repository.


9. Commit the changes.

10. Synchronizing the updated local repository and remote repository at GitHub
11. Check the log. 12. Refresh your GitHub website.

The file index.html is uploaded.

Das könnte Ihnen auch gefallen