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

GIT

Aug 16, 2015

Download

Documents

Asit Shah
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: GIT

The GIT version control system

Presented By: Asit ShahMohil Sheth

Page 2: GIT

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 :

Page 3: GIT

`

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

Page 4: GIT

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

Page 5: GIT

Types of Version Control Systems :

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

Page 6: GIT

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:

Page 7: GIT

- Multiple Backups - Any Work flow

Distributed

Page 8: GIT

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

Page 9: GIT

Work flow Diagram of GIT:

Page 10: 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

Page 11: GIT

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

Page 12: GIT

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]

Page 13: GIT

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]

Page 14: GIT

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]

Page 15: GIT

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

Page 16: GIT

Explore more in GIT

→ man git→ man gittutorial→ man Everyday Git

→ man gitk

Page 17: GIT

References

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

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

Page 18: GIT

Questions ?

Remarks ?

Page 19: GIT

THANK YOU !!