[HCM-August 13] Tech Talk on Git: Use Git to Boost Your Dev Team's Speed and Productivity

3,344 views
3,652 views

Published on

ITviec Tech Talk

HCMC, 10 August 2013

Topic: Git: Use Git to Boost Your Dev Team's Speed and Productivity

Speaker: Mr. Duy Lam from KMS-Technology

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,344
On SlideShare
0
From Embeds
0
Number of Embeds
2,683
Actions
Shares
0
Downloads
20
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • 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
  • [HCM-August 13] Tech Talk on Git: Use Git to Boost Your Dev Team's Speed and Productivity

    1. 1. © 2013 KMS Technology
    2. 2. BOOST YOUR DEV TEAM’S SPEED AND PRODUCTIVITY Duy Lam .::. Aug 2013 © 2013 KMS Technology 2
    3. 3. AGENDA © 2013 KMS Technology 3 Git Introduction Branch in Git Remote Git Git Practices
    4. 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. 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. 6. AGENDA © 2013 KMS Technology 6 Git Introduction Branch in Git Remote Git Git Practices
    7. 7. VERSION CONTROL SYSTEM TYPES © 2013 KMS Technology 7 Centralized Version Control System Distributed Version Control System
    8. 8. THREE GIT TRAITS #1 COMMITS ARE SNAPSHOT © 2013 KMS Technology 8
    9. 9. THREE GIT TRAITS #2 WORK WITHOUT NETWORK © 2013 KMS Technology 9
    10. 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. 11. BASIC WORKS (DEMO)  Create new git repository  Work on git staging area  Update git repository  Check status  Undo © 2013 KMS Technology 11
    12. 12. AGENDA © 2013 KMS Technology 12 Git Introduction Branch in Git Remote Git Git Practices
    13. 13. BRANCH AND HOW IT WORKS © 2013 KMS Technology 13 1 2 3 4
    14. 14. MERGING BRANCH FAST FORWARD © 2013 KMS Technology 14 git merge hotfix
    15. 15. MERGING BRANCH NON FAST FORWARD © 2013 KMS Technology 15 git merge iss53
    16. 16. AGENDA © 2013 KMS Technology 16 Git Introduction Branch in Git Remote Git Git Practices
    17. 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
    18. 18. REMOTE BRANCH © 2013 KMS Technology 18 Time
    19. 19. REMOTE TRACKING BRANCH  a local branch associated with remote branch © 2013 KMS Technology 19 > git branch --track [branch] [remote name]/[branch]
    20. 20. UPDATE WITH REMOTE REPOSITORY GET CHANGES #1 © 2013 KMS Technology 20 Time git fetch origin
    21. 21. UPDATE WITH REMOTE REPOSITORY GET CHANGES #2 © 2013 KMS Technology 21 Time git pull origin master origin/master
    22. 22. UPDATE WITH REMOTE REPOSITORY SAVE CHANGES © 2013 KMS Technology 22 masterorigin/master git.ourcompany.com Time master masterorigin/master git push origin
    23. 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. 24. AGENDA © 2013 KMS Technology 24 Git Introduction Branch in Git Remote Git Git Practices
    25. 25. HIGHLIGHT OF GIT FEATURES (DEMO)  git tag  git stash  git submodule © 2013 KMS Technology 25
    26. 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. 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. 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
    29. 29. GIT PRACTICES © 2013 KMS Technology 29  Prefer --no-ff option on merging
    30. 30. © 2013 KMS Technology 30 Thank You

    ×