Git<br />Can GIT make your life easier? <br />8/31/2010<br />
Agenda<br />About me<br />Introduction to Git<br />Demo<br />Conclusions<br />8/31/2010<br />Inventive Designers – The out...
About me<br />Nick Van den Bleeken<br />R&D Manager at Inventive Designers<br />Member of the XForms WG at W3C<br />8/31/2...
Survey<br />Who is not using source control?<br />SVN?<br />CVS?<br />Git?<br />8/31/2010<br />Inventive Designers – The o...
What is Git?<br />Distributed Version Control System<br />Scalable and Fast<br />Non-linear, custom workflows<br />Subvers...
Git andEclipse<br />EGit: Eclipse Team Provider for Git<br />JGit: lightweight Java library implementing Git<br />Eclipse ...
Git vs SVN/CVS<br />8/31/2010<br />7<br />Inventive Designers – The output innovators<br />Distributed (git)<br />Centrali...
Git Basics (1)<br />8/31/2010<br />Inventive Designers – The output innovators<br />8<br />Stores data as snapshots, not d...
Git Basics (2)<br />Nearly every operation is local<br />Git has integrity<br />Git generally only adds data<br />8/31/201...
Git Basics (3)<br />8/31/2010<br />Inventive Designers – The output innovators<br />10<br />The staging area<br />(Images ...
Git Typical usage<br />8/31/2010<br />Inventive Designers – The output innovators<br />11<br />Working<br />directory<br /...
Branches and tags<br />8/31/2010<br />Inventive Designers – The output innovators<br />12<br />Branches<br />Creating a br...
rebase<br />merge<br />Merging<br />Git determines the best common ancestor to use for its merge base (different than CVS)...
rebase<br />Merging<br />Git determines the best common ancestor to use for its merge base (different than CVS)<br />9/1/2...
Inventive Designers – The output innovators<br />Demo<br />EGitand Gerrit<br />15<br />
Conclusion<br />Git is very powerful<br />Git is scalable and fast<br />Git supports convenient branching and merging<br /...
EGit Features<br />8/31/2010<br />Inventive Designers – The output innovators<br />17<br /><ul><li>gitinit / git clone
git add
git status
Upcoming SlideShare
Loading in …5
×

Git and eclipse

1,757 views

Published on

This presentation gives an introduction to git and EGit was presented at the Belgian Eclipse User Group meeting of August 31th hosted by Inventive Designers.

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

No Downloads
Views
Total views
1,757
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
37
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • git doesn’t just checks out the latest snapshot of the files,but fully mirrors the repository. -&gt; full backup Nearly every operation is localWorkflowSubversion-Style Workflow (centralized model where all developers push to the same server -&gt; shared repository)Integration Manager Workflow (a single person who commits to the &apos;blessed&apos; repository, and then a number of developers who clone from that repository, push to their own independent repositories)Dictator andLieutenants Workflow (Linux kernel -&gt; people are in charge of a specific subsystem of the project and merge in all changes for that subsystem, nother integrator (the &apos;dictator&apos;) can pull changes from only his/her lieutenants and the push to the &apos;blessed&apos; repository)
  • For example the Mozilla repository is reported to be almost 12 GiB when stored in SVN using the fsfs backend. Previously, the fsfs backend also required over 240,000 files in one directory to record all 240,000 commits made over the 10 year project history. This was fixed in SVN 1.5, where every 1000 revisions are placed in a separate directory. The exact same history is stored in Git by only two files totaling just over 420 MiB. SVN requires 30x the disk space to store the same history. An SVN working directory always contains two copies of each file: one for the user to actually work with and another hidden in .svn/ to aid operations such as status, diff and commit. In contrast a Git working directory requires only one small index file that stores about 100 bytes of data per tracked file. On projects with a large number of files this can be a substantial difference in the disk space required per working copy. As a full Git clone is often smaller than a full checkout, this means that Git working directories (including the repositories) are typically smaller than the corresponding SVN working directories. There are even ways in Git to share one repository across many working directories, but in contrast to SVN, this requires the working directories to be colocalized.
  • Most operations in Git only need local files and resources to operate — generally no information is needed from another computer on your network. (e.g.: browse the history of the project)Everything in Git is check-summed before it is stored and is then referred to by that checksum -&gt; change on disk -&gt; checksum fails =&gt; can’t lose information in transit or get file corruption without Git being able to detect it. (SHA-1)Git evens keeps your stashes (Stashing takes the dirty state of your working directory — that is, your modified tracked files and staged changes — and saves it on a stack of unfinished changes that you can reapply at any time.)
  • Git directory stores the metadata and object database for your project. This is the most important part of Git, and it is what is copied when you clone a repository from another computer.Working directory is a single checkout of one version of the project. These files are pulled out of the compressed database in the Git directory and placed on disk for you to use or modify.Staging area is a simple file, generally contained in your Git directory, that stores information about what will go into your next commit. It’s sometimes referred to as the index, but it’s becoming standard to refer to it as the staging area.
  • Creating a new branch is as quick (lightweight) and simple as writing 41 bytes to a file (40 characters SHA-1 checksum of commit and a newline)Long running branches / topic branches -&gt; possible to rebase commits on other branch (e.g.: master)TagsLightweight tag: a branch that doesn’t change -&gt; pointer to a hashAnnotated tag: stored as a full object (check summed; tagger name, e-mail, and date; tagging message; optionally signed and verified with GNU Privacy Guard (GPG))
  • Git determines the best common ancestor to use for its merge base; this is different than CVS, where the developer doing the merge has to figure out the best merge base for themselves.Two parents after merge -&gt; knows who did what after merge (not the case in CVS)Integrate changes from one branch into another:MergeRebase -&gt; re-apply changes ‘on C4’
  • Git determines the best common ancestor to use for its merge base; this is different than CVS, where the developer doing the merge has to figure out the best merge base for themselves.Two parents after merge -&gt; knows who did what after merge (not the case in CVS)Integrate changes from one branch into another:MergeRebase -&gt; re-apply changes ‘on C4’
  • Book translated into German, Chinese, Japanese and Dutch.GitHub is a web-based hosting service for projects that use the Git revision control system
  • Git and eclipse

    1. 1. Git<br />Can GIT make your life easier? <br />8/31/2010<br />
    2. 2. Agenda<br />About me<br />Introduction to Git<br />Demo<br />Conclusions<br />8/31/2010<br />Inventive Designers – The output innovators<br />2<br />
    3. 3. About me<br />Nick Van den Bleeken<br />R&D Manager at Inventive Designers<br />Member of the XForms WG at W3C<br />8/31/2010<br />Inventive Designers – The output innovators<br />3<br />
    4. 4. Survey<br />Who is not using source control?<br />SVN?<br />CVS?<br />Git?<br />8/31/2010<br />Inventive Designers – The output innovators<br />4<br />
    5. 5. What is Git?<br />Distributed Version Control System<br />Scalable and Fast<br />Non-linear, custom workflows<br />Subversion-Style Workflow<br />Integration Manager Workflow<br />Dictator and Lieutenants Workflow<br />…<br />8/31/2010<br />5<br />Inventive Designers – The output innovators<br />
    6. 6. Git andEclipse<br />EGit: Eclipse Team Provider for Git<br />JGit: lightweight Java library implementing Git<br />Eclipse is moving to Gitas SCM (ETA end 2010) <br />8/31/2010<br />6<br />Inventive Designers – The output innovators<br />
    7. 7. Git vs SVN/CVS<br />8/31/2010<br />7<br />Inventive Designers – The output innovators<br />Distributed (git)<br />Centralized (CVS)<br />Full local history<br />Cheap local branching<br />Fast<br />Rebase patches easily<br />Powerful merging<br />No<br />No<br />Slow<br />Patches go stale<br />Merging is a pain<br />
    8. 8. Git Basics (1)<br />8/31/2010<br />Inventive Designers – The output innovators<br />8<br />Stores data as snapshots, not differences<br />(Images taken from http://progit.org/book)<br />
    9. 9. Git Basics (2)<br />Nearly every operation is local<br />Git has integrity<br />Git generally only adds data<br />8/31/2010<br />Inventive Designers – The output innovators<br />9<br />
    10. 10. Git Basics (3)<br />8/31/2010<br />Inventive Designers – The output innovators<br />10<br />The staging area<br />(Images taken from http://whygitisbetterthanx.com)<br />
    11. 11. Git Typical usage<br />8/31/2010<br />Inventive Designers – The output innovators<br />11<br />Working<br />directory<br />Staging<br />area<br />Local repo<br />remote<br />repo<br />git add<br />git commit<br />git push<br />git fetch<br />git checkout<br />git merge<br />
    12. 12. Branches and tags<br />8/31/2010<br />Inventive Designers – The output innovators<br />12<br />Branches<br />Creating a branch is quick (write 41 bytes)<br />Long running / Topic branches<br />Tags<br />Lightweight tag <br />branch that doesn’t change<br />Annotated tag<br />Check summed<br />Tagger info<br />Tagging message<br />Optionally signed (GNU Privacy Guard)<br />(Images taken from http://progit.org/book)<br />
    13. 13. rebase<br />merge<br />Merging<br />Git determines the best common ancestor to use for its merge base (different than CVS)<br />8/31/2010<br />Inventive Designers – The output innovators<br />13<br />(Images taken from http://progit.org/book)<br />
    14. 14. rebase<br />Merging<br />Git determines the best common ancestor to use for its merge base (different than CVS)<br />9/1/2010<br />Inventive Designers – The output innovators<br />14<br />(Images taken from http://progit.org/book)<br />
    15. 15. Inventive Designers – The output innovators<br />Demo<br />EGitand Gerrit<br />15<br />
    16. 16. Conclusion<br />Git is very powerful<br />Git is scalable and fast<br />Git supports convenient branching and merging<br />All revisions of every file are locally available <br />Git is the feature SCM of Eclipse<br />8/31/2010<br />Inventive Designers – The output innovators<br />16<br />
    17. 17. EGit Features<br />8/31/2010<br />Inventive Designers – The output innovators<br />17<br /><ul><li>gitinit / git clone
    18. 18. git add
    19. 19. git status
    20. 20. git commit
    21. 21. git diff(partial)
    22. 22. git fetch
    23. 23. Git log(partial)
    24. 24. git merge</li></ul>git rebase<br /><ul><li>git remote</li></ul>git pull<br /><ul><li>git push
    25. 25. git stash
    26. 26. git branch
    27. 27. git tag(partial)
    28. 28. git checkout(partial)
    29. 29. git config
    30. 30. git format-patch(partial)
    31. 31. git mv/git rm(partial)
    32. 32. git reset</li></li></ul><li>Resources<br />Gitdocumentation http://git-scm.com/documentation<br />Pro Git book http://progit.org/book<br />EGitUser Guide http://wiki.eclipse.org/EGit/User_Guide<br />GitHubhttps://github.com/<br />8/31/2010<br />Inventive Designers – The output innovators<br />18<br />
    33. 33. Inventive Designers – The output innovators<br />Questions?<br />19<br />

    ×