版本控制 GITkewang
2git burst !!!
3RCS comparison
4server command offline software(e.g.)Local optional cp/mv/rm optional your brainCentralized MUST simple no SVNDistributed...
5Git history
6Linux kernel file management●1991~2002 : Local– 大多數 Linux kernel 維護工作花在 patch 及歸檔上●2002~2005 : BitKeeper– 開始改為商用型 RCS : B...
7from SVN migrate toGit you must know
8you must know● Repositories– SVN has a central repository.– Git has a personal repository, also has an officialrepository...
9Installing......http://git-scm.com/book/en/Getting-Started-Installing-Git
10Creating a new repository1.mkdir prj2.cd prj3.git init
11File Status Lifecycle
12
13File Status Lifecycle● untracked unmodified→– git add filename● unmodified modified: modify some files→● modified staged...
14File Status Lifecycle● unmodified untracked→– git rm filename● modified unmodified→– git checkout -- filename● staged mo...
15SVN maps to Git
16Importing an existing project● Git1.git init2.git add .3.git commit● SVN1.svnadmin create prj_repo2.svn import . proj_repo
17Check what youve done● Git1.git diff● SVN1.svn diff | less
18Reverting a file● Git● git reset --hard HEAD filename● or● git revert HEAD filename (new commit)● SVN1.svn revert filename
19Branching● Git1.git branch new_branch old_branch2.git checkout new_branch● SVN1.svn copy svn://svn.example.com/old_branc...
20Merging● Git● git merge branch● SVN● svn merge -r 20:HEADsvn://svn.example.com/branches/branch
21and more commands...
22git remoting
23
24github morepopular !!!
25publicrepositoriesprivaterepositoriesotherGitHub unlimited paidwiki, issue tracking,pull request, forkBitbucket unlimite...
26Set up Git● Give a name– git config --global user.name "Your NameHere"– git config --global user.email"your_email@exampl...
27GitHub
28Step by Step
29Bitbucket
30Step by Step
31Downloading someone project● git clone url prj
32Add a remote repository1.git remote add originhttps://example.com/hello.git2.git push origin master
33Push & Pull● Push (like svn commit)– git push● Pull (like svn update)– git pull
34Links● MY GITHUB RÉSUMÉ●Git flow開發流程● GitSvnCrashCourse●Git 教學(2):Git Branch 的操作與基本工作流程● 3.2 Git Branching - Basic Branc...
35via http://blog.gslin.org/archives/2013/01/17/3136/
36
Upcoming SlideShare
Loading in …5
×

版本控制Git

493 views
411 views

Published on

Published in: Technology
0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
493
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
22
Comments
0
Likes
5
Embeds 0
No embeds

No notes for slide

版本控制Git

  1. 1. 版本控制 GITkewang
  2. 2. 2git burst !!!
  3. 3. 3RCS comparison
  4. 4. 4server command offline software(e.g.)Local optional cp/mv/rm optional your brainCentralized MUST simple no SVNDistributed optional complex optional git
  5. 5. 5Git history
  6. 6. 6Linux kernel file management●1991~2002 : Local– 大多數 Linux kernel 維護工作花在 patch 及歸檔上●2002~2005 : BitKeeper– 開始改為商用型 RCS : BitKeeper●2005~ 現在: Git– BitKeeper 與 Linux kernel 合作結束, Linus Torvalds自行開發新的 RCS ,名為 Git
  7. 7. 7from SVN migrate toGit you must know
  8. 8. 8you must know● Repositories– SVN has a central repository.– Git has a personal repository, also has an officialrepository.● Revisions– SVN revisions start at 1 and every commitincrement.– Git revisions has 40-character SHA-1(you can think ofas random string).
  9. 9. 9Installing......http://git-scm.com/book/en/Getting-Started-Installing-Git
  10. 10. 10Creating a new repository1.mkdir prj2.cd prj3.git init
  11. 11. 11File Status Lifecycle
  12. 12. 12
  13. 13. 13File Status Lifecycle● untracked unmodified→– git add filename● unmodified modified: modify some files→● modified staged→– git add filename● staged unmodified→– git commit
  14. 14. 14File Status Lifecycle● unmodified untracked→– git rm filename● modified unmodified→– git checkout -- filename● staged modified→– git reset HEAD filename
  15. 15. 15SVN maps to Git
  16. 16. 16Importing an existing project● Git1.git init2.git add .3.git commit● SVN1.svnadmin create prj_repo2.svn import . proj_repo
  17. 17. 17Check what youve done● Git1.git diff● SVN1.svn diff | less
  18. 18. 18Reverting a file● Git● git reset --hard HEAD filename● or● git revert HEAD filename (new commit)● SVN1.svn revert filename
  19. 19. 19Branching● Git1.git branch new_branch old_branch2.git checkout new_branch● SVN1.svn copy svn://svn.example.com/old_branchsvn://svn.example.com/branches/new_branch2.svn switchsvn://svn.example.com/branches/new_branch
  20. 20. 20Merging● Git● git merge branch● SVN● svn merge -r 20:HEADsvn://svn.example.com/branches/branch
  21. 21. 21and more commands...
  22. 22. 22git remoting
  23. 23. 23
  24. 24. 24github morepopular !!!
  25. 25. 25publicrepositoriesprivaterepositoriesotherGitHub unlimited paidwiki, issue tracking,pull request, forkBitbucket unlimited freewiki, issue tracking,pull request, fork
  26. 26. 26Set up Git● Give a name– git config --global user.name "Your NameHere"– git config --global user.email"your_email@example.com"● Caching my password– git config --global credential.helpercache
  27. 27. 27GitHub
  28. 28. 28Step by Step
  29. 29. 29Bitbucket
  30. 30. 30Step by Step
  31. 31. 31Downloading someone project● git clone url prj
  32. 32. 32Add a remote repository1.git remote add originhttps://example.com/hello.git2.git push origin master
  33. 33. 33Push & Pull● Push (like svn commit)– git push● Pull (like svn update)– git pull
  34. 34. 34Links● MY GITHUB RÉSUMÉ●Git flow開發流程● GitSvnCrashCourse●Git 教學(2):Git Branch 的操作與基本工作流程● 3.2 Git Branching - Basic Branching and Merging●寫給大家的Git教學● Code School - Try Git
  35. 35. 35via http://blog.gslin.org/archives/2013/01/17/3136/
  36. 36. 36

×