Your SlideShare is downloading. ×
0
GIT, Beginner to Advanced Survey Rafał Rusin TouK http://touk.pl http://rrusin.blogspot.com
What is GIT? <ul><li>Global Information Tracker when it works &quot;goddamn idiotic truckload of sh*t&quot;: when it breaks
Distributed Version Control System Unlike SVN, which is centralized
Designed for speed git log, git checkout <branch>, git blame – are done locally
Designed for branching and merging Includes tuned 3 way merge algorithm for resolving conflicts, with handling merges incl...
Works on data, not on file names (hashes) </li></ul>
GIT has Distributed Model <ul><li>Centralized & Distributed model </li></ul>as asdf
Getting Started <ul><li>Configuring GIT Create a file ~/.gitconfig and set up user name and email – this info may be distr...
Initialize repository
git init
Upcoming SlideShare
Loading in...5
×

Git, Beginner to Advanced Survey

3,071

Published on

Basic introduction into GIT and some useful features and tools overview.

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

No Downloads
Views
Total Views
3,071
On Slideshare
0
From Embeds
0
Number of Embeds
8
Actions
Shares
0
Downloads
67
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Git, Beginner to Advanced Survey"

  1. 1. GIT, Beginner to Advanced Survey Rafał Rusin TouK http://touk.pl http://rrusin.blogspot.com
  2. 2. What is GIT? <ul><li>Global Information Tracker when it works &quot;goddamn idiotic truckload of sh*t&quot;: when it breaks
  3. 3. Distributed Version Control System Unlike SVN, which is centralized
  4. 4. Designed for speed git log, git checkout <branch>, git blame – are done locally
  5. 5. Designed for branching and merging Includes tuned 3 way merge algorithm for resolving conflicts, with handling merges including file renames.
  6. 6. Works on data, not on file names (hashes) </li></ul>
  7. 7. GIT has Distributed Model <ul><li>Centralized & Distributed model </li></ul>as asdf
  8. 8. Getting Started <ul><li>Configuring GIT Create a file ~/.gitconfig and set up user name and email – this info may be distributed globally
  9. 9. Initialize repository
  10. 10. git init
  11. 11. Open GUI
  12. 12. git gui
  13. 13. Stage files for commit and create a commit
  14. 14. Commit is stored locally </li></ul>
  15. 15. Connecting to External World <ul><li>Cloning remote repository
  16. 16. git clone [email_address] :rafalrusin/ode-scripts.git (example)
  17. 17. There is support for protocols, like ssh and file:
  18. 18. git clone ../other-dir, git clone ssh://user@host/full-path-to-project
  19. 19. Create local commits
  20. 20. Push to remote repository
  21. 21. git gui / remote / push
  22. 22. Note: It may fail due to not merged newest remote commits. You will need to do fetch, merge and push again. </li></ul>
  23. 23. Working with Branches <ul><li>GIT is usable for maintaining forks
  24. 24. Merging to latest upstream release is easy
  25. 25. Creating a branch from current HEAD
  26. 26. git checkout -b NAME
  27. 27. Merging other branch into HEAD
  28. 28. git merge NAME
  29. 29. If a confict occurs, use git mergetool (like meld)
  30. 30. Rebasing a set of commits onto other head
  31. 31. git rebase –onto OTHER_HEAD <starting-from-commit> </li></ul>
  32. 32. Advanced Commands <ul><li>Git cherry-pick – merge single commit into current HEAD
  33. 33. Git stash – store local changes to work on other branch
  34. 34. Amend last commit – update last commit by new changeset
  35. 35. Git grep – lookup data over indexed files only
  36. 36. Git blame – provides author and revision for each line of file
  37. 37. Git submodules – similar to svn:externals, adds possibility of joining different projects into one http://speirs.org/blog/2009/5/11/understanding-git-submodules.html
  38. 38. Git apply –index <a.patch> - applies a patch and stages it in index
  39. 39. Git show <commit> - show a diff for commit
  40. 40. Git reset –hard, git checkout-index -f <a.file> - drop local changes </li></ul>
  41. 41. Publishing Code With GitWeb <ul><li>Bare repositories
  42. 42. git clone –bare <repo> - creates repository without working copy
  43. 43. SSH repositories
  44. 44. ssh://user@server/full-path-to-repo
  45. 45. Native GIT repositories (eg. via gitosis)
  46. 46. [email_address] :path/repo.git
  47. 47. Configuring project description
  48. 48. description, README.html, config [gitweb] owner, URL </li></ul>
  49. 49. Integrating With Hudson <ul><li>Hudson Continous Integration has GIT support
  50. 50. CI builds using GIT have advantage
  51. 51. You can set up Hudson to build multiple branches. Then developers may submit their forked branch to see if they work passes tests. Then if it's OK, they can merge to master. This way you won't have unstable commits in master branch. </li></ul>
  52. 52. References <ul><li>Running GIT under Windows (msysgit) http://nathanj.github.com/gitguide/index.html - also explains features of git gui
  53. 53. GitHub – social coding
  54. 54. git.apache.org, github.com/apache
  55. 55. Tools - git-scm.com
  56. 56. Who uses GIT?
  57. 57. Android, Jquery, digg.com, linux kernel, Qt, YUI
  58. 58. http://en.wikipedia.org/wiki/Git_%28software%29#Projects_using_Git </li></ul>
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×