Upload
kms-technology
View
769
Download
0
Tags:
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
© 2013 KMS Technology 1
BOOST YOUR DEV TEAM’S SPEED AND PRODUCTIVITY
Duy Lam .::. Aug 2013
© 2013 KMS Technology 2
AGENDA
Git Introduction Branch in Git Remote Git Git Practices
© 2013 KMS Technology 3
ABOUT ME
Software Architectat KMS Technology Vietnam
[email protected] http://vn.linkedin.com/in/duylamphuong
Lâm Phương Duy
© 2013 KMS Technology 4
WHAT YOU TAKE IN THE END
GitUse GitUse Git EffectivelyGit for advanced needsGit or else?
© 2013 KMS Technology 5
AGENDA
Git Introduction Branch in Git Remote Git Git Practices
© 2013 KMS Technology 6
VERSION CONTROL SYSTEM TYPES
Centralized Version Control System
Distributed Version Control System
© 2013 KMS Technology 7
THREE GIT TRAITS#1 COMMITS ARE
SNAPSHOT
© 2013 KMS Technology 8
THREE GIT TRAITS#2 WORK WITHOUT
NETWORK
© 2013 KMS Technology 9
THREE GIT TRAITS#3 TWO STATES
Working Directory Git Repository
git addgit rmetc.
git commit
Git Index / Staging Area
© 2013 KMS Technology 10
BASIC WORKS(DEMO)
Create new git repository Work on git staging area Update git repository Check status Undo
© 2013 KMS Technology 11
AGENDA
Git Introduction Branch in Git Remote Git Git Practices
© 2013 KMS Technology 12
BRANCH AND HOW IT WORKS
1 2
34
© 2013 KMS Technology 13
MERGING BRANCH FAST FORWARD
git merge hotfix
© 2013 KMS Technology 14
MERGING BRANCHNON FAST FORWARD
git merge iss53
© 2013 KMS Technology 15
AGENDA
Git Introduction Branch in Git Remote Git Git Practices
© 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
© 2013 KMS Technology 17
REMOTE BRANCH
Time
© 2013 KMS Technology 18
REMOTE TRACKING BRANCH
a local branch associated with remote branch
> git branch --track [branch] [remote name]/[branch]
© 2013 KMS Technology 19
UPDATE WITH REMOTE REPOSITORY
GET CHANGES #1
Time
git fetch origin
© 2013 KMS Technology 20
UPDATE WITH REMOTE REPOSITORY
GET CHANGES #2
Time
git pull origin
master
origin/master
© 2013 KMS Technology 21
UPDATE WITH REMOTE REPOSITORY
SAVE CHANGES
masterorigin/master
git.ourcompany.com
Time
master
masterorigin/master
git push origin
© 2013 KMS Technology 22
BASIC WORKS(DEMO)
Create remote git repository Get new commits from remote
repository Save new commits to remote
repository
© 2013 KMS Technology 23
AGENDA
Git Introduction Branch in Git Remote Git Git Practices
© 2013 KMS Technology 24
HIGHLIGHT OF GIT FEATURES
(DEMO) git tag git stash git submodule
© 2013 KMS Technology 25
GIT CLIENTS
http://git-scm.com: Git CLI (command line interface)
UI clients– TortoiseGit– SmartGit– SourceTree Free– Git Extensions
© 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
© 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
© 2013 KMS Technology 28
GIT PRACTICES
Prefer --no-ff option on merging
© 2013 KMS Technology
THANK YOU
© 2013 KMS Technology 29
Thank You