29
BOOST YOUR DEV TEAM’S SPEED AND PRODUCTIVITY Duy Lam .::. Aug 2013 © 2013 KMS Technology 1

Git - Boost Your DEV Team Speed and Productivity

Embed Size (px)

DESCRIPTION

At the tech talks hosted by ITViec, Mr. Duy Lam - Software Architect of KMS Technology delivered a topic of Git - a free and open source distributed control system.

Citation preview

Page 1: Git - Boost Your DEV Team Speed and Productivity

© 2013 KMS Technology 1

BOOST YOUR DEV TEAM’S SPEED AND PRODUCTIVITY

Duy Lam .::. Aug 2013

Page 2: Git - Boost Your DEV Team Speed and Productivity

© 2013 KMS Technology 2

AGENDA

Git Introduction Branch in Git Remote Git Git Practices

Page 3: Git - Boost Your DEV Team Speed and Productivity

© 2013 KMS Technology 3

ABOUT ME

Software Architectat KMS Technology Vietnam

[email protected] http://vn.linkedin.com/in/duylamphuong

Lâm Phương Duy

Page 4: Git - Boost Your DEV Team Speed and Productivity

© 2013 KMS Technology 4

WHAT YOU TAKE IN THE END

GitUse GitUse Git EffectivelyGit for advanced needsGit or else?

Page 5: Git - Boost Your DEV Team Speed and Productivity

© 2013 KMS Technology 5

AGENDA

Git Introduction Branch in Git Remote Git Git Practices

Page 6: Git - Boost Your DEV Team Speed and Productivity

© 2013 KMS Technology 6

VERSION CONTROL SYSTEM TYPES

Centralized Version Control System

Distributed Version Control System

Page 7: Git - Boost Your DEV Team Speed and Productivity

© 2013 KMS Technology 7

THREE GIT TRAITS#1 COMMITS ARE

SNAPSHOT

Page 8: Git - Boost Your DEV Team Speed and Productivity

© 2013 KMS Technology 8

THREE GIT TRAITS#2 WORK WITHOUT

NETWORK

Page 9: Git - Boost Your DEV Team Speed and Productivity

© 2013 KMS Technology 9

THREE GIT TRAITS#3 TWO STATES

Working Directory Git Repository

git addgit rmetc.

git commit

Git Index / Staging Area

Page 10: Git - Boost Your DEV Team Speed and Productivity

© 2013 KMS Technology 10

BASIC WORKS(DEMO)

Create new git repository Work on git staging area Update git repository Check status Undo

Page 11: Git - Boost Your DEV Team Speed and Productivity

© 2013 KMS Technology 11

AGENDA

Git Introduction Branch in Git Remote Git Git Practices

Page 12: Git - Boost Your DEV Team Speed and Productivity

© 2013 KMS Technology 12

BRANCH AND HOW IT WORKS

1 2

34

Page 13: Git - Boost Your DEV Team Speed and Productivity

© 2013 KMS Technology 13

MERGING BRANCH FAST FORWARD

git merge hotfix

Page 14: Git - Boost Your DEV Team Speed and Productivity

© 2013 KMS Technology 14

MERGING BRANCHNON FAST FORWARD

git merge iss53

Page 15: Git - Boost Your DEV Team Speed and Productivity

© 2013 KMS Technology 15

AGENDA

Git Introduction Branch in Git Remote Git Git Practices

Page 16: Git - Boost Your DEV Team Speed and Productivity

© 2013 KMS Technology 16

REMOTE URLS

Local /data/git/project.gitSSH* user@server:project.gitGit git://server/project.git

HTTP http://server/project.git

(*) Setup authentication: https://help.github.com/articles/generating-ssh-keys

Page 17: Git - Boost Your DEV Team Speed and Productivity

© 2013 KMS Technology 17

REMOTE BRANCH

Time

Page 18: Git - Boost Your DEV Team Speed and Productivity

© 2013 KMS Technology 18

REMOTE TRACKING BRANCH

a local branch associated with remote branch

> git branch --track [branch] [remote name]/[branch]

Page 19: Git - Boost Your DEV Team Speed and Productivity

© 2013 KMS Technology 19

UPDATE WITH REMOTE REPOSITORY

GET CHANGES #1

Time

git fetch origin

Page 20: Git - Boost Your DEV Team Speed and Productivity

© 2013 KMS Technology 20

UPDATE WITH REMOTE REPOSITORY

GET CHANGES #2

Time

git pull origin

master

origin/master

Page 21: Git - Boost Your DEV Team Speed and Productivity

© 2013 KMS Technology 21

UPDATE WITH REMOTE REPOSITORY

SAVE CHANGES

masterorigin/master

git.ourcompany.com

Time

master

masterorigin/master

git push origin

Page 22: Git - Boost Your DEV Team Speed and Productivity

© 2013 KMS Technology 22

BASIC WORKS(DEMO)

Create remote git repository Get new commits from remote

repository Save new commits to remote

repository

Page 23: Git - Boost Your DEV Team Speed and Productivity

© 2013 KMS Technology 23

AGENDA

Git Introduction Branch in Git Remote Git Git Practices

Page 24: Git - Boost Your DEV Team Speed and Productivity

© 2013 KMS Technology 24

HIGHLIGHT OF GIT FEATURES

(DEMO) git tag git stash git submodule

Page 25: Git - Boost Your DEV Team Speed and Productivity

© 2013 KMS Technology 25

GIT CLIENTS

http://git-scm.com: Git CLI (command line interface)

UI clients– TortoiseGit– SmartGit– SourceTree Free– Git Extensions

Page 26: Git - Boost Your DEV Team Speed and Productivity

© 2013 KMS Technology 26

GIT OR SVN ?

Git SVN

Speed of operation Faster

Data loss Less

Independent and isolated environment Yes

Access control Yes

Locking mechanisms Yes

Storage space 1/30 size

Page 27: Git - Boost Your DEV Team Speed and Productivity

© 2013 KMS Technology 27

GIT PRACTICES

Line-ending issue on platforms

Do not miss any file when committing in conflicted merge

Windows Mac & Linux

Problem \r\n \n

Solution git config --global core.autocrlf true git config --global core.autocrlf input

Page 28: Git - Boost Your DEV Team Speed and Productivity

© 2013 KMS Technology 28

GIT PRACTICES

Prefer --no-ff option on merging

Page 29: Git - Boost Your DEV Team Speed and Productivity

© 2013 KMS Technology

THANK YOU

© 2013 KMS Technology 29

Thank You