Introduction To Git

3,071 views

Published on

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

No Downloads
Views
Total views
3,071
On SlideShare
0
From Embeds
0
Number of Embeds
227
Actions
Shares
0
Downloads
118
Comments
0
Likes
9
Embeds 0
No embeds

No notes for slide





















































































  • Introduction To Git

    1. 1. Introduction to GIT Boby - Thenetcircle 2010
    2. 2. Plan • Basics • Workflow • Roadmap
    3. 3. Basics • What is GIT? • How does it work? • Why shall i use GIT?
    4. 4. What is GIT? • Version control system • Distributed • Modern • Created by Linus Torvald
    5. 5. Distributed? • No central repository • Mostly local • Remote access u1 u3 Central u2 u1 u2 u3 u4
    6. 6. Modern • Fast • Clean • Rethink of VCS
    7. 7. Usage • Linux kernel • Symfony 2 • asOauthPlugin • Many others on github, gitorious...
    8. 8. How? • Key-value storage • File based • Checksum via SHA-1 • Inside the .git folder
    9. 9. How? http://progit.org/book/ch1-3.html
    10. 10. How? http://progit.org/book/ch1-3.html
    11. 11. How? • Commits are snapshots • Modified files are copied • Unmodified files keep the same reference
    12. 12. How? Head Head Change file B Rev 3AB40 Commit changes Rev 98FD0 Folder 290FF Folder 290FF File A 343BA File A 343BA File B FF0934 File B 5589A
    13. 13. What about SVN? • Old, slow, complex • Merges are a pain!!! • Merges suck!!!
    14. 14. What about others? • Mercurial, Bazaar... all distributed VCS • The rest (VSS, CVS...)
    15. 15. Basic workflow • Initialize a repository • Adding a file
    16. 16. Basic workflow • Modifying a file • Viewing the difference • Committing
    17. 17. What is this add crap? • The “index” !!! • Another step in the workflow • Act as staging area
    18. 18. Basic workflow http://marklodato.github.com/visual-git-guide/
    19. 19. Basic workflow • Make 2 modifications on the same file • Commit the first one • Commit the second one
    20. 20. Branch workflow • Create a new branch • Modify some stuff • Commit in this branch
    21. 21. Branch workflow • Merge my new branch back to main • Commit
    22. 22. Branch workflow • Modify branch test • Modify branch master • Merge • Solve conflict
    23. 23. Branch workflow • Modify branch test • Modify branch master • Update test from master
    24. 24. Branch workflow Master Branch test Branch Rev 3AB40 Rev 3AB40 Rev AE449 Rev 34E79 Rev CC34F
    25. 25. Branch workflow Master Branch test Rev 3AB40 Rev 3AB40 Rev AE449 Rev AE449 Rebase Rev CC34F Rev CC34F Rev 34E79
    26. 26. Update your branch from the main =
    27. 27. “git rebase main” =
    28. 28. 2 seconds =
    29. 29. Holly crap!!! Awesome!!! Bye bye SVN!!!
    30. 30. Remote workflow • Checkout a remote branch • Modify • Send the modification to the remote
    31. 31. External workflow • git submodule: - longer workflow - allows direct co/push • git subtree • external dependency manager
    32. 32. Dev workflow • Clone the main branch • Create branch for feature • Commit changes inside • Rebase often to keep the branch up to date • Push back • Tell the maintainer to merge your changes
    33. 33. Main repo } master git clone git pull git merge git pull remote server Boby repo git checkout -b Boby repo master eflower feat } git clone git pull git push git rebase local Working copy eflower feat
    34. 34. Roadmap • Install git • Training • Transition with git-svn • Move all branches/script to git • End of SVN • Enjoy!
    35. 35. Installation? • Version 1.7 of GIT • CLI • tortoise git for designer • Remote repository with Gitorious
    36. 36. Links • http://progit.org/book/ • http://marklodato.github.com/visual-git-guide/ • http://hginit.com/ • http://git.or.cz/course/svn.html
    37. 37. Questions?

    ×