khorshed presentation-digital world2016

29
Version Control With

Upload: khorshed-alam

Post on 24-Jan-2017

69 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Khorshed presentation-digital world2016

Version Control With

Page 2: Khorshed presentation-digital world2016

/Khorshed.RS

MD. KHORSHED ALAMCEO & Founder

/in/Khorshedrs

/Khorshed.RS

Page 3: Khorshed presentation-digital world2016

Everyday Workflow

Create a fileSave itEdit itSave it againEtc …..

Page 4: Khorshed presentation-digital world2016

Everyday Workflow

Page 5: Khorshed presentation-digital world2016

Everyday Workflow

Page 6: Khorshed presentation-digital world2016

Can we automate this?

When WhatWhyWho

For each document version, we need to know

Page 7: Khorshed presentation-digital world2016

Story of Git

"I'm an egotistical bastard, so I name all my projects after myself. First Linux, now Git”

Linus Torvalds, PC World. 2012-07-14

Page 8: Khorshed presentation-digital world2016

Story of Git

Linus needed a new source code revision manager forLinux, and none of the available options in 2005 where

good enough, so he wrote his own in.

Kernel 2.6.12 was the first release managed by Git andversion 1.0 of Git was released in December 2005.

Page 9: Khorshed presentation-digital world2016

What Is Git ?Distributed Version

Control System Directory

Tree History Storage System

Stupid Content Tracker

Page 10: Khorshed presentation-digital world2016

Whatever You Think About It ….

uper Cool

Page 11: Khorshed presentation-digital world2016

Distributed

1Everyone has the complete history

3

2

4

Everything is done offlineExcept Push / Pull

No central authorityExcept by convention

Changes can be shared without a server

Page 12: Khorshed presentation-digital world2016

Git popularity according to OpenHub.net

CVS10%

GIT38%

MERCURIAL

2%SUBVERSION

48%

Page 13: Khorshed presentation-digital world2016

Git might feel difficult at first,but once you learn it, you neverwant to go back to anything less

flexible and powerful.

Page 14: Khorshed presentation-digital world2016

Installing GIThttps://git-scm.com

Page 15: Khorshed presentation-digital world2016

First Time SetupCheck Version

$ git --version

Setup User$ git config --global user.name “rssoftware”$ git config --global user.email ”[email protected]”$ git config --list

Page 16: Khorshed presentation-digital world2016

Init$ cd project

$ git init

Page 17: Khorshed presentation-digital world2016

Status$ git status

Page 18: Khorshed presentation-digital world2016

.gitignore$ touch .gitignore

Page 19: Khorshed presentation-digital world2016

Add$ git add <file>

or$ git add .

Page 20: Khorshed presentation-digital world2016

Reset$ git reset <file>

or$ git reset .

Page 21: Khorshed presentation-digital world2016

Commit$ git commit –m "detailed message"

Page 22: Khorshed presentation-digital world2016

Log$ git log

Page 23: Khorshed presentation-digital world2016

Show$ git show

or$ git show <hash_id>

Page 24: Khorshed presentation-digital world2016

DiffWorking :

$ git diff$ git diff <file>

Staging :$ git diff --cached$ git diff –-cached <file>

Page 25: Khorshed presentation-digital world2016

Branching

$git branch my-feature

One feature = One branch

Page 26: Khorshed presentation-digital world2016

Working in the Branch

$git checkout my-feature$git commit (x2)

Page 27: Khorshed presentation-digital world2016

Merge

$git checkout master$git diff master..my-feature

$git merge my-feature

Page 28: Khorshed presentation-digital world2016

Clean Up

$git branch -d my-feature

Page 29: Khorshed presentation-digital world2016

Thank you for your attention