SlideShare ist ein Scribd-Unternehmen logo
1 von 45
Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn    Understanding and Using Git at Eclipse    Chris Aniszczyk (Red Hat) Shawn Pearce (Google) Robin Rosenberg (Dewire) Matthias Sohn (SAP)
Understanding Git at Eclipse | © 2010 by Chris Aniszczyk, Shawn Pearce and Matthias Sohn, made available under the EPL v1.0  2 Outline ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn  Here's the Deal All of us want to see Git successful at Eclipse    Git like any other DVCS has a bit of a learning curve This tutorial is made up of a brief introduction followed by some exercises on using Git, EGit and Gerrit
Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn  No Free Lunch                 The best way to learn Git is to use Git Please stop and ask us questions at anytime
Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn  A History Lesson 2005    Linus Torvalds starts Git 2006    Proof-of-concept, quite unusable 2007    Index reader, quickdiff 2008    Add history view, commit, push/fetch 2009    Moved to Eclipse.org 2010   Automatic IP Logs            Diff/Merge            Cleanup API            Exit Incubation            Release 1.0
Git Concepts     We need the basics
Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn  What is Git? Distributed Version Control System (DVCS)   Originally created for the Linux Kernel   If you want comedy, watch Linus' talk at Google      http://www.youtube.com/watch?v=4XpnKHJAok8
Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn  Centralized VCS ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn  Distributed VCS Examples? Git and Hg    Each user has a full local copy of the repository Forks happen, deal with it There is no real master repository like in a CVCS
Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn  How does it work? A DVCS operates at the level of a  changeset   Logically, a repository is made up from an initial empty state, followed by many changesets   Changesets are identified by a SHA-1 hash value    e.g., 0878a8189e6a3ae1ded86d9e9c7cbe3f
Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn  It's all about the changesets previous: 48b2179994d494485b79504e8b5a6b23ce24a026 --- a/README.txt +++ b/README.txt @@ -1 +1 @@ -SVN is great +Git is great previous: 6ff60e964245816221414736d7e5fe6972246ead --- a/README.txt +++ b/README.txt @@ -1 +1 @@ -Git is great +SVN is great Changesets contain pointers to the previous changeset
Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn  Branches The current version of your repository is simply a pointer to the end of the tree   The default "trunk" in Git is called "master"  The tip of the current branch is called "HEAD"   Any branch can be referred to by its hash id   Creating branches in a DVCS is fast, you simply point to a different element in the tree on disk already
Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn  Merging DVCSs are all about merging   Given that each node in the changeset tree contains a pointer to its previous node (and transitively, to the beginning of time), it's much more powerful than the standard flat CVCS diff. In other words, not only do you know what changes need to be made, but also  what point in history they need to be made . So, if you have a changeset which renames a file, and then merge in a changeset which points to the file as it was before it was renamed, then a CVCS will just fall over; but a DVCS will be able to apply the change  before  the rename occurred, and then play forward the changes.
Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn  Merging Merges are just the weaving together of two (or more) local branches into one   However, unlike CVCS, you don't have to specify anything about where you're merging from and to; the trees automatically know what their split point was in the past, and can work it out from there. Merging is much easier in a DVCS like Git
Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn  Pulling and Pushing ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn  Cloning and Remotes git clone git://egit.eclipse.org/egit.git     Where you can push or pull to is configured on a per (local) repository basis   git remote add github http://github.com/zx/myegit.git   origin is the default remote; you can have many remotes
Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn  Git Internals Cryptographic signatures ...  ensures data integrity Snapshot based ...  saves whole project
Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn  Git Internals Cryptographic signatures ...  ensures data integrity Snapshot based ...  saves whole project   History stored as graph  ... accurate records
Exercises     You're armed with the basics now
Exercise - Installing Git and EGit ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Documentation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exercise - Setting up a repository (git) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exercise - Setting up a repository (EGit) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exercise - Making Changes (git) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exercise - Making Changes (EGit) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exercise - Browsing History (git) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exercise - Browsing History (EGit) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exercise - Branching (git) - 1 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exercise - Branching (git) -2 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exercise - Branching (EGit) ,[object Object],[object Object],[object Object]
Exercise - SSH Configuration ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Gerrit Registration ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exercise - Collaborating (git) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exercise - Collaborating (git) - 2 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
EMail based collaboration ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exercise - Collaborating (EGit) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exercise - Collaborating (EGit) - 2 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Staying up to date ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Rebase ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Rebasing (interactive) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Reviewing and Maintaining ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Tagging ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Conclusion   Do we love Git yet?
Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn  Conclusion DVCS like Git are powerful Git supports convenient branching and merging    Git is very fast and scales well   Gerrit enables a nice code review workflow  Git is the future SCM of Eclipse
Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn  Resources Ask questions on the EGit/JGit forums    http://git-scm.com/documentation is your friend Read the Pro Git book - http://progit.org/book/

Weitere ähnliche Inhalte

Was ist angesagt?

OSGi Versioning & Testing
OSGi Versioning & TestingOSGi Versioning & Testing
OSGi Versioning & TestingChris Aniszczyk
 
Introducing Git and git flow
Introducing Git and git flow Introducing Git and git flow
Introducing Git and git flow Sebin Benjamin
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github Max Claus Nunes
 
Using Git in Eclipse - Eclipse Summit Europe 2010-11-03
Using Git in Eclipse - Eclipse Summit Europe 2010-11-03Using Git in Eclipse - Eclipse Summit Europe 2010-11-03
Using Git in Eclipse - Eclipse Summit Europe 2010-11-03msohn
 
Helios in Action: Git at Eclipse
Helios in Action: Git at EclipseHelios in Action: Git at Eclipse
Helios in Action: Git at EclipseChris Aniszczyk
 
GitLab as an Alternative Development Platform for Github.com
GitLab as an Alternative Development Platform for Github.comGitLab as an Alternative Development Platform for Github.com
GitLab as an Alternative Development Platform for Github.comB1 Systems GmbH
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHubRick Umali
 
Version Control with Git
Version Control with GitVersion Control with Git
Version Control with GitLuigi De Russis
 
Git and GitHub - The beginning
Git and GitHub - The beginning Git and GitHub - The beginning
Git and GitHub - The beginning Gemma Catolino
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsLee Hanxue
 
Git Introduction Tutorial
Git Introduction TutorialGit Introduction Tutorial
Git Introduction TutorialThomas Rausch
 
Know the Science behind WorkFlows using Git & GitHhub
Know the Science behind WorkFlows using Git & GitHhubKnow the Science behind WorkFlows using Git & GitHhub
Know the Science behind WorkFlows using Git & GitHhubEdureka!
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git TutorialSage Sharp
 
Assign, commit, and review - A developer’s guide to OpenStack contribution-20...
Assign, commit, and review - A developer’s guide to OpenStack contribution-20...Assign, commit, and review - A developer’s guide to OpenStack contribution-20...
Assign, commit, and review - A developer’s guide to OpenStack contribution-20...OpenCity Community
 

Was ist angesagt? (20)

Git & git hub
Git & git hubGit & git hub
Git & git hub
 
OSGi Versioning & Testing
OSGi Versioning & TestingOSGi Versioning & Testing
OSGi Versioning & Testing
 
Git
GitGit
Git
 
Introducing Git and git flow
Introducing Git and git flow Introducing Git and git flow
Introducing Git and git flow
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github
 
Using Git in Eclipse - Eclipse Summit Europe 2010-11-03
Using Git in Eclipse - Eclipse Summit Europe 2010-11-03Using Git in Eclipse - Eclipse Summit Europe 2010-11-03
Using Git in Eclipse - Eclipse Summit Europe 2010-11-03
 
Helios in Action: Git at Eclipse
Helios in Action: Git at EclipseHelios in Action: Git at Eclipse
Helios in Action: Git at Eclipse
 
Git training with Devaamo
Git training with DevaamoGit training with Devaamo
Git training with Devaamo
 
GitLab as an Alternative Development Platform for Github.com
GitLab as an Alternative Development Platform for Github.comGitLab as an Alternative Development Platform for Github.com
GitLab as an Alternative Development Platform for Github.com
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
Version Control with Git
Version Control with GitVersion Control with Git
Version Control with Git
 
Git and GitHub - The beginning
Git and GitHub - The beginning Git and GitHub - The beginning
Git and GitHub - The beginning
 
Git in Eclipse
Git in EclipseGit in Eclipse
Git in Eclipse
 
Egit 1.0
Egit 1.0Egit 1.0
Egit 1.0
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
 
Git Introduction Tutorial
Git Introduction TutorialGit Introduction Tutorial
Git Introduction Tutorial
 
Know the Science behind WorkFlows using Git & GitHhub
Know the Science behind WorkFlows using Git & GitHhubKnow the Science behind WorkFlows using Git & GitHhub
Know the Science behind WorkFlows using Git & GitHhub
 
Git training
Git trainingGit training
Git training
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
 
Assign, commit, and review - A developer’s guide to OpenStack contribution-20...
Assign, commit, and review - A developer’s guide to OpenStack contribution-20...Assign, commit, and review - A developer’s guide to OpenStack contribution-20...
Assign, commit, and review - A developer’s guide to OpenStack contribution-20...
 

Ähnlich wie Git Tutorial Title

Git and Eclipse - Eclipse Helios DemoCamp Jena 2010
Git and Eclipse - Eclipse Helios DemoCamp Jena 2010Git and Eclipse - Eclipse Helios DemoCamp Jena 2010
Git and Eclipse - Eclipse Helios DemoCamp Jena 2010msohn
 
Kubernetes GitOps featuring GitHub, Kustomize and ArgoCD
Kubernetes GitOps featuring GitHub, Kustomize and ArgoCDKubernetes GitOps featuring GitHub, Kustomize and ArgoCD
Kubernetes GitOps featuring GitHub, Kustomize and ArgoCDSunnyvale
 
Introduction to Git for developers
Introduction to Git for developersIntroduction to Git for developers
Introduction to Git for developersDmitry Guyvoronsky
 
Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23
Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23
Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23msohn
 
Introduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech ArticleIntroduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech ArticlePRIYATHAMDARISI
 
Collaboration With Git and GitHub
Collaboration With Git and GitHubCollaboration With Git and GitHub
Collaboration With Git and GitHubAlec Clews
 
Git basics with notes
Git basics with notesGit basics with notes
Git basics with notesSurabhi Gupta
 
Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and GithubWycliff1
 
A practical 30m intro to Git vcs
A practical 30m intro to Git vcsA practical 30m intro to Git vcs
A practical 30m intro to Git vcsOlivier Garcia
 
Git Tutorial A Comprehensive Guide for Beginners.pdf
Git Tutorial A Comprehensive Guide for Beginners.pdfGit Tutorial A Comprehensive Guide for Beginners.pdf
Git Tutorial A Comprehensive Guide for Beginners.pdfuzair
 
Brush up on using github
Brush up on using githubBrush up on using github
Brush up on using githubSebin Benjamin
 

Ähnlich wie Git Tutorial Title (20)

Git and Eclipse - Eclipse Helios DemoCamp Jena 2010
Git and Eclipse - Eclipse Helios DemoCamp Jena 2010Git and Eclipse - Eclipse Helios DemoCamp Jena 2010
Git and Eclipse - Eclipse Helios DemoCamp Jena 2010
 
Kubernetes GitOps featuring GitHub, Kustomize and ArgoCD
Kubernetes GitOps featuring GitHub, Kustomize and ArgoCDKubernetes GitOps featuring GitHub, Kustomize and ArgoCD
Kubernetes GitOps featuring GitHub, Kustomize and ArgoCD
 
GitHub Event.pptx
GitHub Event.pptxGitHub Event.pptx
GitHub Event.pptx
 
Introduction to Git for developers
Introduction to Git for developersIntroduction to Git for developers
Introduction to Git for developers
 
Git Overview
Git OverviewGit Overview
Git Overview
 
Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23
Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23
Development with Git and Gerrit - Eclipse DemoCamp Stuttgart - 2010-11-23
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
 
Migrating To GitHub
Migrating To GitHub  Migrating To GitHub
Migrating To GitHub
 
Introduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech ArticleIntroduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech Article
 
Evolution ofversioncontrolinopensource
Evolution ofversioncontrolinopensourceEvolution ofversioncontrolinopensource
Evolution ofversioncontrolinopensource
 
Collaboration With Git and GitHub
Collaboration With Git and GitHubCollaboration With Git and GitHub
Collaboration With Git and GitHub
 
3 Git
3 Git3 Git
3 Git
 
Git basics with notes
Git basics with notesGit basics with notes
Git basics with notes
 
Git training (basic)
Git training (basic)Git training (basic)
Git training (basic)
 
Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and Github
 
A practical 30m intro to Git vcs
A practical 30m intro to Git vcsA practical 30m intro to Git vcs
A practical 30m intro to Git vcs
 
Git session 1
Git session 1Git session 1
Git session 1
 
Git and github
Git and githubGit and github
Git and github
 
Git Tutorial A Comprehensive Guide for Beginners.pdf
Git Tutorial A Comprehensive Guide for Beginners.pdfGit Tutorial A Comprehensive Guide for Beginners.pdf
Git Tutorial A Comprehensive Guide for Beginners.pdf
 
Brush up on using github
Brush up on using githubBrush up on using github
Brush up on using github
 

Mehr von Chris Aniszczyk

Bringing an open source project to the Linux Foundation
Bringing an open source project to the Linux FoundationBringing an open source project to the Linux Foundation
Bringing an open source project to the Linux FoundationChris Aniszczyk
 
Starting an Open Source Program Office (OSPO)
Starting an Open Source Program Office (OSPO)Starting an Open Source Program Office (OSPO)
Starting an Open Source Program Office (OSPO)Chris Aniszczyk
 
Open Container Initiative Update
Open Container Initiative UpdateOpen Container Initiative Update
Open Container Initiative UpdateChris Aniszczyk
 
Cloud Native Landscape (CNCF and OCI)
Cloud Native Landscape (CNCF and OCI)Cloud Native Landscape (CNCF and OCI)
Cloud Native Landscape (CNCF and OCI)Chris Aniszczyk
 
Rise of Open Source Programs
Rise of Open Source ProgramsRise of Open Source Programs
Rise of Open Source ProgramsChris Aniszczyk
 
The Open Container Initiative (OCI) at 12 months
The Open Container Initiative (OCI) at 12 monthsThe Open Container Initiative (OCI) at 12 months
The Open Container Initiative (OCI) at 12 monthsChris Aniszczyk
 
Open Source Lessons from the TODO Group
Open Source Lessons from the TODO GroupOpen Source Lessons from the TODO Group
Open Source Lessons from the TODO GroupChris Aniszczyk
 
Getting Students Involved in Open Source
Getting Students Involved in Open SourceGetting Students Involved in Open Source
Getting Students Involved in Open SourceChris Aniszczyk
 
Life at Twitter + Career Advice for Students
Life at Twitter + Career Advice for StudentsLife at Twitter + Career Advice for Students
Life at Twitter + Career Advice for StudentsChris Aniszczyk
 
Creating an Open Source Office: Lessons from Twitter
Creating an Open Source Office: Lessons from TwitterCreating an Open Source Office: Lessons from Twitter
Creating an Open Source Office: Lessons from TwitterChris Aniszczyk
 
The Open Source... Behind the Tweets
The Open Source... Behind the TweetsThe Open Source... Behind the Tweets
The Open Source... Behind the TweetsChris Aniszczyk
 
Apache Mesos at Twitter (Texas LinuxFest 2014)
Apache Mesos at Twitter (Texas LinuxFest 2014)Apache Mesos at Twitter (Texas LinuxFest 2014)
Apache Mesos at Twitter (Texas LinuxFest 2014)Chris Aniszczyk
 
Evolution of The Twitter Stack
Evolution of The Twitter StackEvolution of The Twitter Stack
Evolution of The Twitter StackChris Aniszczyk
 
Open Source Craft at Twitter
Open Source Craft at TwitterOpen Source Craft at Twitter
Open Source Craft at TwitterChris Aniszczyk
 
Open Source Compliance at Twitter
Open Source Compliance at TwitterOpen Source Compliance at Twitter
Open Source Compliance at TwitterChris Aniszczyk
 
Evolution of Version Control In Open Source
Evolution of Version Control In Open SourceEvolution of Version Control In Open Source
Evolution of Version Control In Open SourceChris Aniszczyk
 
Introduction to EclipseRT (JAX 2010)
Introduction to EclipseRT (JAX 2010)Introduction to EclipseRT (JAX 2010)
Introduction to EclipseRT (JAX 2010)Chris Aniszczyk
 
EclipseRT, Equinox and OSGi
EclipseRT, Equinox and OSGiEclipseRT, Equinox and OSGi
EclipseRT, Equinox and OSGiChris Aniszczyk
 

Mehr von Chris Aniszczyk (20)

Bringing an open source project to the Linux Foundation
Bringing an open source project to the Linux FoundationBringing an open source project to the Linux Foundation
Bringing an open source project to the Linux Foundation
 
Starting an Open Source Program Office (OSPO)
Starting an Open Source Program Office (OSPO)Starting an Open Source Program Office (OSPO)
Starting an Open Source Program Office (OSPO)
 
Open Container Initiative Update
Open Container Initiative UpdateOpen Container Initiative Update
Open Container Initiative Update
 
Cloud Native Landscape (CNCF and OCI)
Cloud Native Landscape (CNCF and OCI)Cloud Native Landscape (CNCF and OCI)
Cloud Native Landscape (CNCF and OCI)
 
Rise of Open Source Programs
Rise of Open Source ProgramsRise of Open Source Programs
Rise of Open Source Programs
 
The Open Container Initiative (OCI) at 12 months
The Open Container Initiative (OCI) at 12 monthsThe Open Container Initiative (OCI) at 12 months
The Open Container Initiative (OCI) at 12 months
 
Open Source Lessons from the TODO Group
Open Source Lessons from the TODO GroupOpen Source Lessons from the TODO Group
Open Source Lessons from the TODO Group
 
Getting Students Involved in Open Source
Getting Students Involved in Open SourceGetting Students Involved in Open Source
Getting Students Involved in Open Source
 
Life at Twitter + Career Advice for Students
Life at Twitter + Career Advice for StudentsLife at Twitter + Career Advice for Students
Life at Twitter + Career Advice for Students
 
Creating an Open Source Office: Lessons from Twitter
Creating an Open Source Office: Lessons from TwitterCreating an Open Source Office: Lessons from Twitter
Creating an Open Source Office: Lessons from Twitter
 
The Open Source... Behind the Tweets
The Open Source... Behind the TweetsThe Open Source... Behind the Tweets
The Open Source... Behind the Tweets
 
Apache Mesos at Twitter (Texas LinuxFest 2014)
Apache Mesos at Twitter (Texas LinuxFest 2014)Apache Mesos at Twitter (Texas LinuxFest 2014)
Apache Mesos at Twitter (Texas LinuxFest 2014)
 
Evolution of The Twitter Stack
Evolution of The Twitter StackEvolution of The Twitter Stack
Evolution of The Twitter Stack
 
Open Source Craft at Twitter
Open Source Craft at TwitterOpen Source Craft at Twitter
Open Source Craft at Twitter
 
Open Source Compliance at Twitter
Open Source Compliance at TwitterOpen Source Compliance at Twitter
Open Source Compliance at Twitter
 
Evolution of Version Control In Open Source
Evolution of Version Control In Open SourceEvolution of Version Control In Open Source
Evolution of Version Control In Open Source
 
SWTBot Tutorial
SWTBot TutorialSWTBot Tutorial
SWTBot Tutorial
 
Eclipse e4
Eclipse e4Eclipse e4
Eclipse e4
 
Introduction to EclipseRT (JAX 2010)
Introduction to EclipseRT (JAX 2010)Introduction to EclipseRT (JAX 2010)
Introduction to EclipseRT (JAX 2010)
 
EclipseRT, Equinox and OSGi
EclipseRT, Equinox and OSGiEclipseRT, Equinox and OSGi
EclipseRT, Equinox and OSGi
 

Git Tutorial Title

  • 1. Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn   Understanding and Using Git at Eclipse   Chris Aniszczyk (Red Hat) Shawn Pearce (Google) Robin Rosenberg (Dewire) Matthias Sohn (SAP)
  • 2.
  • 3. Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn Here's the Deal All of us want to see Git successful at Eclipse   Git like any other DVCS has a bit of a learning curve This tutorial is made up of a brief introduction followed by some exercises on using Git, EGit and Gerrit
  • 4. Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn No Free Lunch                 The best way to learn Git is to use Git Please stop and ask us questions at anytime
  • 5. Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn A History Lesson 2005    Linus Torvalds starts Git 2006    Proof-of-concept, quite unusable 2007    Index reader, quickdiff 2008    Add history view, commit, push/fetch 2009    Moved to Eclipse.org 2010   Automatic IP Logs            Diff/Merge            Cleanup API            Exit Incubation            Release 1.0
  • 6. Git Concepts     We need the basics
  • 7. Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn What is Git? Distributed Version Control System (DVCS)   Originally created for the Linux Kernel   If you want comedy, watch Linus' talk at Google     http://www.youtube.com/watch?v=4XpnKHJAok8
  • 8.
  • 9. Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn Distributed VCS Examples? Git and Hg   Each user has a full local copy of the repository Forks happen, deal with it There is no real master repository like in a CVCS
  • 10. Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn How does it work? A DVCS operates at the level of a changeset   Logically, a repository is made up from an initial empty state, followed by many changesets   Changesets are identified by a SHA-1 hash value    e.g., 0878a8189e6a3ae1ded86d9e9c7cbe3f
  • 11. Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn It's all about the changesets previous: 48b2179994d494485b79504e8b5a6b23ce24a026 --- a/README.txt +++ b/README.txt @@ -1 +1 @@ -SVN is great +Git is great previous: 6ff60e964245816221414736d7e5fe6972246ead --- a/README.txt +++ b/README.txt @@ -1 +1 @@ -Git is great +SVN is great Changesets contain pointers to the previous changeset
  • 12. Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn Branches The current version of your repository is simply a pointer to the end of the tree   The default "trunk" in Git is called "master" The tip of the current branch is called "HEAD"   Any branch can be referred to by its hash id   Creating branches in a DVCS is fast, you simply point to a different element in the tree on disk already
  • 13. Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn Merging DVCSs are all about merging   Given that each node in the changeset tree contains a pointer to its previous node (and transitively, to the beginning of time), it's much more powerful than the standard flat CVCS diff. In other words, not only do you know what changes need to be made, but also what point in history they need to be made . So, if you have a changeset which renames a file, and then merge in a changeset which points to the file as it was before it was renamed, then a CVCS will just fall over; but a DVCS will be able to apply the change before the rename occurred, and then play forward the changes.
  • 14. Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn Merging Merges are just the weaving together of two (or more) local branches into one   However, unlike CVCS, you don't have to specify anything about where you're merging from and to; the trees automatically know what their split point was in the past, and can work it out from there. Merging is much easier in a DVCS like Git
  • 15.
  • 16. Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn Cloning and Remotes git clone git://egit.eclipse.org/egit.git    Where you can push or pull to is configured on a per (local) repository basis   git remote add github http://github.com/zx/myegit.git   origin is the default remote; you can have many remotes
  • 17. Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn Git Internals Cryptographic signatures ... ensures data integrity Snapshot based ... saves whole project
  • 18. Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn Git Internals Cryptographic signatures ... ensures data integrity Snapshot based ... saves whole project   History stored as graph ... accurate records
  • 19. Exercises     You're armed with the basics now
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43. Conclusion   Do we love Git yet?
  • 44. Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn Conclusion DVCS like Git are powerful Git supports convenient branching and merging   Git is very fast and scales well   Gerrit enables a nice code review workflow Git is the future SCM of Eclipse
  • 45. Understanding and Using Git at Eclipse | © 2010 by C. Aniszczyk, S. Pearce, R. Rosenberg and M. Sohn Resources Ask questions on the EGit/JGit forums   http://git-scm.com/documentation is your friend Read the Pro Git book - http://progit.org/book/

Hinweis der Redaktion

  1. git config --global core.autocrlf false Commit as-is to be compatible with current EGIT Have pre-packaged Eclipses 3.5 for Mac, Windows and Linux on USB key
  2. Mention git mergetool and various conflict edtors xxdiff vimdiff kdiff3 emacsdiff beydondcompare
  3. Watch out for white space damage by certain MUAs