Git 101 for_tarad_dev

471 views

Published on

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
471
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
17
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Git 101 for_tarad_dev

  1. 1. Git 1012013/03/12 @somkiat 1
  2. 2. Why Version Control ? 2
  3. 3. Why Version Control ? Collaboration issues !!! 3
  4. 4. Version Control• Local• Centralize• Distributed 4
  5. 5. Local 5http://git-scm.com/book/en/Getting-Started-About-Version-Control
  6. 6. Centralize 6http://git-scm.com/book/en/Getting-Started-About-Version-Control
  7. 7. Distributed 7http://git-scm.com/book/en/Getting-Started-About-Version-Control
  8. 8. Version Control• Local – Copy file and folder• Centralize – Control Version System ( CVS ) – Subversion ( SVN )• Distributed – Git – Mercurial Hg – Bazaar 8
  9. 9. Why Git ?1. Distributed => No Single of Failure 9
  10. 10. Why Git ?2. Simple design :: Less config file VS 10
  11. 11. Why Git ? 3. Speed :: Work on local 11From git real slide ( http://www.codeschool.com )
  12. 12. Who use Git ? http://git-scm.com/ 12
  13. 13. Starting with Git• Command line interface• Many Graphic User Interface (GUI)• Download at http://git-scm.com 13
  14. 14. Git Help $ git help 14
  15. 15. Git Help$ git help <command> 15
  16. 16. Git Setting $ git config <name> <value>• $ git config --global user.name “Your name”• $ git config --global user.email “Your email”• $ git config --global color.ui true• $ git config --list 16
  17. 17. Starting your repository $ git init 17
  18. 18. Starting your repository $ git init 18
  19. 19. Git work flowhttp://git-scm.com/book/en/Getting-Started-Git-Basics 19
  20. 20. Git work flow• Create file README.txt – Start as untracked• Add file to staging area – Ready to take a picture• Commit change – Snapshot on the stage 20
  21. 21. Create file README.txt$touch README.txt$git status New file and untracked 21
  22. 22. Add file to staging area$git add README.txt$git status Staged file 22
  23. 23. Commit change$git commit –m “Create file README.txt”$git status Working on branch master 23
  24. 24. TODO• Modify file README.txt• Create file LICENSE• Add both files to staging area• Commit change 24
  25. 25. Different way to add• git add <list of file>• git add –all• git add *.txt• git add docs/*.txt• git add docs/• git add “*.txt” 25
  26. 26. Git timeline history$git log History message 26
  27. 27. Homework• Learn git with github.com – http://try.github.com/ 27
  28. 28. Next• Git merge• Git branch• Collaboration – Git remote • Branch • Tag• Git rebase• History and configuration 28

×