Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

Keep practicing GIT

Slide 3

Slide 3 text

Quick Recap

Slide 4

Slide 4 text

The 3 states • Modified • Staged • Committed

Slide 5

Slide 5 text

File status lifecycle

Slide 6

Slide 6 text

Configuration Identity $git config --global user.name “Dhrumil Shah” $git config --global user.email “dhuma1981@gmail.com” $git config --global user.email “dhuma1981@gmail.com”

Slide 7

Slide 7 text

Creating a repository $git init

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

Add new file $git add readme.txt

Slide 10

Slide 10 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 11

Slide 11 text

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

Slide 12

Slide 12 text

Show status $git status

Slide 13

Slide 13 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 14

Slide 14 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 15

Slide 15 text

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

Slide 16

Slide 16 text

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

Slide 17

Slide 17 text

Push to remote repository $git push –u origin master

Slide 18

Slide 18 text

Cloning a remote repository $git clone e.g. $git clone https://github.com/dhuma1981/GDGAhmedabad_HOWGIT.git

Slide 19

Slide 19 text

Pull from remote repository $git pull

Slide 20

Slide 20 text

Git Branching

Slide 21

Slide 21 text

Branches are “Pointers” to commits

Slide 22

Slide 22 text

Branches can diverge

Slide 23

Slide 23 text

Branches can be merged

Slide 24

Slide 24 text

Create new branch $git branch e.g. $git branch tester

Slide 25

Slide 25 text

Switching branch Switch to already created branch $git checkout tester Create new branch and switch to it Create new branch and switch to it $git checkout -b developer

Slide 26

Slide 26 text

Show all branches All branches $git branch $git branch -v Merged branches Merged branches $git branch --merged Unmerged branches $git branch –no-merged

Slide 27

Slide 27 text

Merge branches $git merge e.g. $git merge tester

Slide 28

Slide 28 text

Successful merge

Slide 29

Slide 29 text

Congratulations

Slide 30

Slide 30 text

GITHUB

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

No content