Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

Without Version Control System

Slide 3

Slide 3 text

Solutions •Version control system •Concurrent Version System(CVS) •Apache Subversion(SVN) •Mercurial GIT •GIT

Slide 4

Slide 4 text

GIT

Slide 5

Slide 5 text

What is GIT? •Distributed (Decentralized) version (Decentralized) version control System

Slide 6

Slide 6 text

Why GIT? • Speed • Simple Design • Strong support for parallel branches • Fully distributed • Able to handle large projects • Able to handle large projects • Ensure integrity

Slide 7

Slide 7 text

Why GIT? Most VCS tracks changes

Slide 8

Slide 8 text

Why GIT? GIT tracks snapshots

Slide 9

Slide 9 text

Who uses GIT?

Slide 10

Slide 10 text

GIT is a file system GIT thinks of its data like a set of snapshots of mini system of mini system

Slide 11

Slide 11 text

GIT has integrity GIT uses SHA-1 for checksum In GIT everything is checksum In GIT everything is checksum

Slide 12

Slide 12 text

GIT doesn’t delete GIT generally only adds data You can easily recover if you got messed up You can easily recover if you got messed up

Slide 13

Slide 13 text

Workflow

Slide 14

Slide 14 text

The 3 states • Modified • Staged • Committed

Slide 15

Slide 15 text

File status lifecycle

Slide 16

Slide 16 text

Installing GIT

Slide 17

Slide 17 text

Configuration Identity $git config --global user.name “Dhrumil Shah” $git config --global user.email “[email protected]” $git config --global user.email “[email protected]

Slide 18

Slide 18 text

Creating a repository $git init

Slide 19

Slide 19 text

Creating a repository $git clone URL E.g. https://github.com/dhuma1981/WearableDemo

Slide 20

Slide 20 text

Add new file $git add readme.txt

Slide 21

Slide 21 text

Remove file From staging area $git rm --cached test.txt From index and file system From index and file system $git rm test.txt

Slide 22

Slide 22 text

Commit changes $git commit $git commit –m “First” $git commit –am “Second”

Slide 23

Slide 23 text

Show status $git status

Slide 24

Slide 24 text

Show log Entire $git log Date Filtering Date Filtering $git log --since=2.weeks $git log --since=“2 years 1 day 3 minutes ago”

Slide 25

Slide 25 text

Show difference Unstagged changes $git diff Staged changes $git diff --cached $git diff --cached Relative to specific revision $git diff 17765f $git diff HEAD^

Slide 26

Slide 26 text

Show commits Last commit $git show Specific commit Specific commit $git show 17765f $git show HEAD^

Slide 27

Slide 27 text

Add remote repositories $git remote add origin “GIT URL” e.g. $git remote add origin https://github.com/dhuma1981/GDGAhmedabad_HOWGIT.git

Slide 28

Slide 28 text

Push to remote repository $git push –u origin master

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

No content