19
The GIT version control system Presented By: Asit Shah Mohil Sheth

GIT

Embed Size (px)

Citation preview

The GIT version control system

Presented By: Asit ShahMohil Sheth

2

→ What is version control system and why we need it ?

→ Types of version control systems

→ GIT version control system

→ GIT workflow

→ Advantages of GIT

→ How GIT works.

1

Content :

`

- Developed in 2005 by “Linus Torvalds”- Distributed Version Control System - Available in both GUI and Command line Variants- Released under the GNU General Public License version 2.0, which is an open source license.

Definition :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.

History :

GIT version control system

Why we need version control system :

If you contentiously changing or editing files in your project or experimenting with your files in your task then version control system is must for you.

Characteristics :

- Branching and Merging - Small and Fast- Distributed - Data assurance- Staging area

Types of Version Control Systems :

1. Local version control system.2. Centralized Version Control System.3. Distributed Version Control System.

Branching and Merging :- stand apart features from nearly every other VCS out there is it branching model. - This features allows you to do things like:

Frictionless Context Switching.Role-Based Code lines.Feature Based Work flow.Disposable Experimentation.

Small and Fast:

Characteristics:

- Multiple Backups - Any Work flow

Distributed

Data Assurance:- Every file and commit is checksummed and retrieved by its checksum when checked back out. It's impossible to get anything out of Git other than the exact bits you put in.- It is also impossible to change any file, date, commit message, or any other data in a Git repository without changing the IDs of everything after it. This means that if you have a commit ID, you can be assured not only that your project is exactly the same as when it was committed, but that nothing in its history was changed.

Staging Area

Work flow Diagram of GIT:

Advantages

- Snapshot Concept- Nearly everything is local - Integrity- GIT generally only adds data- Three states- Available in both : command line and GUI- Available on every popular systems : windows,mac,linux

New to GIT ? Let's start from the beginning.

Step 1 : Install GIT

→ sudo apt-get install git

Step 2 : Initial Setup ( one time only )

→ git config - -global user.name “asit”→ git config - -global user.email [email protected]→ git config - -global core.editor emacs/gedit/vi→ git config - -list

Step 3 : Creating Repositories

→ git init→ git init [project-name]→ git clone [url]

Step 4 : Adding files to the repository

→ git add [file-name] / git -rm - -cached [file] / git mv [f1] [f2] → git status→ git diff→ git commit -m “[descriptive message]”→ git reset [file-name]

Step 5 : Branching (The most important and amazing feature of GIT)

→ git branch → git branch [name]→ git checkout [name]→ git merge [name]→ git branch -d [name]

Step 6 : Reviewing History→ git log→ git log - -follow [file]→ git show [commit]

Now you have done almost every things , what will you do if you want to get back to previous version ..

Step 7 : Redo Commits→ git reset [commit]→ git reset - -hard [commit]

GIT has facility to communicate with remote servers / repository:

Though most of git commands work with local repositories,but once you completed with local one and want to store on remote repository or want to take date data from it,you can use following commands:

→ git fetch→ git pull→ git push→ git remote

Explore more in GIT

→ man git→ man gittutorial→ man Everyday Git

→ man gitk

References

→ www.git-scm.com | official website for git

→ Pro git , 2nd edition by Schott Chacon and Ben Straub | Book

Questions ?

Remarks ?

THANK YOU !!