More Related Content Similar to [HCM-August 13] Tech Talk on Git: Use Git to Boost Your Dev Team's Speed and Productivity (20) [HCM-August 13] Tech Talk on Git: Use Git to Boost Your Dev Team's Speed and Productivity2. BOOST YOUR DEV TEAM’S SPEED
AND PRODUCTIVITY
Duy Lam .::. Aug 2013
© 2013 KMS Technology 2
3. AGENDA
© 2013 KMS Technology 3
Git
Introduction
Branch in Git Remote Git Git Practices
4. ABOUT ME
Software Architect
at KMS Technology Vietnam
duylam@kms-technology.com
http://vn.linkedin.com/in/duylamphuong
© 2013 KMS Technology 4
Lâm Phương Duy
5. WHAT YOU TAKE IN THE END
Git
Use Git
Use Git Effectively
Git for advanced needs
Git or else?
© 2013 KMS Technology 5
6. AGENDA
© 2013 KMS Technology 6
Git
Introduction
Branch in Git Remote Git Git Practices
7. VERSION CONTROL SYSTEM TYPES
© 2013 KMS Technology 7
Centralized Version
Control System
Distributed Version
Control System
10. THREE GIT TRAITS
#3 TWO STATES
© 2013 KMS Technology 10
Working Directory Git Repository
git add
git rm
etc.
git commit
Git Index / Staging
Area
11. BASIC WORKS
(DEMO)
Create new git repository
Work on git staging area
Update git repository
Check status
Undo
© 2013 KMS Technology 11
12. AGENDA
© 2013 KMS Technology 12
Git
Introduction
Branch in Git Remote Git Git Practices
16. AGENDA
© 2013 KMS Technology 16
Git
Introduction
Branch in Git Remote Git Git Practices
17. REMOTE URLS
© 2013 KMS Technology 17
Local /data/git/project.git
SSH*
user@server:project.git
Git git://server/project.git
HTTP http://server/project.git
(*) Setup authentication: https://help.github.com/articles/generating-ssh-keys
19. REMOTE TRACKING BRANCH
a local branch associated with remote branch
© 2013 KMS Technology 19
> git branch --track [branch] [remote name]/[branch]
20. UPDATE WITH REMOTE REPOSITORY
GET CHANGES #1
© 2013 KMS Technology 20
Time
git fetch origin
21. UPDATE WITH REMOTE REPOSITORY
GET CHANGES #2
© 2013 KMS Technology 21
Time
git pull origin
master
origin/master
22. UPDATE WITH REMOTE REPOSITORY
SAVE CHANGES
© 2013 KMS Technology 22
masterorigin/master
git.ourcompany.com
Time
master
masterorigin/master
git push origin
23. BASIC WORKS
(DEMO)
Create remote git repository
Get new commits from remote repository
Save new commits to remote repository
© 2013 KMS Technology 23
24. AGENDA
© 2013 KMS Technology 24
Git
Introduction
Branch in Git Remote Git Git Practices
25. HIGHLIGHT OF GIT FEATURES
(DEMO)
git tag
git stash
git submodule
© 2013 KMS Technology 25
26. GIT CLIENTS
http://git-scm.com: Git CLI (command line
interface)
UI clients
– TortoiseGit
– SmartGit
– SourceTree Free
– Git Extensions
© 2013 KMS Technology 26
27. GIT OR 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
28. GIT PRACTICES
Line-ending issue on platforms
Do not miss any file when committing in
conflicted merge
© 2013 KMS Technology 28
Windows Mac & Linux
Problem rn n
Solution git config --global core.autocrlf true git config --global core.autocrlf input
Editor's Notes A commit contains:changes at the time it’s createda pointer to parent commit containing unchanged thingscommit ID is a hex string for hashed content Staging Area ~ temporary storage managed by Git Go through following commands:gitinitgit add, rm, mvgit commitgit commit –amendgit log, status, diffgit reset, checkout (undo + go to commit) Branch ~ pointer to a commitHEAD ~ alias for latest commit in branch remote branch is controlled by git fetch + git pushgit clone by default creates a master remote branch Update configuration to allow pushing: $ gitconfigreceive.denyCurrentBranch ignoregit clonegit fetch (+ pull)git push speed of operation: commit, viewing history, reverting changes, etc.data loss: SVN can have corrupted revision databaseindependent and isolated: Git allows user to work without network connection and keep their work privatelylock mechanims: plays an important role when it comes to non-mergable binary files such as graphic assetsaccess control: define read/write permission on particular folder, allow to work on particular folder instead of getting entire tree Line-ending issueWindows: convert CRLF to LF when commit, and convert LF to CRLF when checkout to file systemLinux: convert CRLF to LF when commit onlyDo not miss: if you miss any file, it means changes in that files from the branch you’re merging will be discarded