Git Version Control System

3,700 views

Published on

Git - Distributed Source Version Control System - The first public seminar of KMS Technology in 2013.

Published in: Technology
1 Comment
4 Likes
Statistics
Notes
No Downloads
Views
Total views
3,700
On SlideShare
0
From Embeds
0
Number of Embeds
10
Actions
Shares
0
Downloads
226
Comments
1
Likes
4
Embeds 0
No embeds

No notes for slide

Git Version Control System

  1. 1. Distributed SourceVersion Control System Apr 2013
  2. 2. Who am iLâm Phương DuySoftware Architectduylam@kms-technology.com Use Git from 2009 http://vn.linkedin.com/in/duylamphuong Confidential 2
  3. 3. Objectives To use Git in software project as doing with SVN or TFS To self study Git for advanced needs Confidential 3
  4. 4. SyllabusGit theory Daily development workflow Daily collaboration workflowMore on Git Confidential 4
  5. 5. Git’s history Source Version Control in Linux kernel projectuse patches and archived files revoke BitKeeper, Linus Torvald started developing Git1999 2002 now 2005 use BitKeeper (a commercal system) Confidential 5
  6. 6. SyllabusGit theory Daily development workflow Daily collaboration workflowMore on Git Confidential 6
  7. 7. Version Control SystemsCentralized Version Distributed Version Control Systems Control Systems Confidential 7
  8. 8. Git theory Data = Snapshot No network Three states Confidential 8
  9. 9. Git theory Data = Snapshot No network Three states Confidential 9
  10. 10. Git theory Data = Snapshot No network Three states git add git rm git status Confidential 10
  11. 11. SyllabusGit theory Daily development workflow Daily collaboration workflowMore on Git Confidential 11
  12. 12. Launch Git shell Confidential 12
  13. 13. Git in daily development git log git init git status git clone git commit git diffSetup repository Change repository Check repository git checkout git add git checkout git reset git rm git mv Undoing Update staging area Confidential 13
  14. 14. Git remote url protocolsLocal /data/git/project.gitSSH user@server:project.git Git git://server/project.gitHTTP http://server/project.git Confidential 14
  15. 15. Remote repository git fetchgit remote add <url> git pullgit clone git push Get remote repository Get updates Confidential 15
  16. 16. Authenticate with remote repository1) Generate key files with ssh-keygen2) Upload %USER_HOME%/.ssh/id_rsa.pub to remote repository hosting Read more: https://help.github.com/articles/generating-ssh-keys Confidential 16
  17. 17. SyllabusGit theory Daily development workflow Daily collaboration workflowMore on Git Confidential 17
  18. 18. Branch (git branch)1 4 snapshot2 3 git checkout master Confidential 18
  19. 19. Merging - Fast forwardgit merge hotfix Confidential 19
  20. 20. Merging - Non fast forwardgit merge iss53(resolve conflicts if any) Confidential 20
  21. 21. Remote branch workflowsCreate default remote branchGet changes from remote repositoryMerge changes from remote branch in local (two methods)Update changes to remote repository Confidential 21
  22. 22. Create default remote branch remote branch remote branch Time Confidential 22
  23. 23. Get changes from remote repository git fetch origin Time Confidential 23
  24. 24. Merge changes from remote branch in local (v.1) origin/master master git merge origin/master Time Confidential 24
  25. 25. Merge changes from remote branch in local (v.2) git fetch + git pull origin git merge origin/master master Time Confidential 25
  26. 26. Update changes to remote repository master git.ourcompany.com git push origin/master origin/master master origin/master master Time Confidential 26
  27. 27. Remote tracking branch• Use tracking branch to let Git know which server and branch to push / pull• Create remote tracking branch: > git checkout -b [branch] [remote name]/[branch] Confidential 27
  28. 28. SyllabusGit theory Daily development workflow Daily collaboration workflowMore on Git Confidential 28
  29. 29. Useful features> git tag> git stash> git submodule Confidential 29
  30. 30. Common problems> git push! [rejected] master -> master (non-fast forward)Error: failed to push some refs to ‘git@gitproxy:rip747/cfwheels.git’ > git pull Merge made by recursive > git push To git@gitproxy:rip747/cfwheels.git 1717535..1406e8c master -> master Confidential 30
  31. 31. Common problems (cont.)• To remove remote branch e.g origin/iss105 > git push origin :iss105• Use git tag to mark releases Confidential 31
  32. 32. ReferenceFor everything you want to read more about Git http://git-scm.com Confidential 32
  33. 33. THANK YOU

×