Git and eclipse

Preview:

DESCRIPTION

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.

Citation preview

04/12/2023

Git

Can GIT make your life easier?

04/12/2023 Inventive Designers – The output innovators

2

Agenda

• About me• Introduction to Git• Demo• Conclusions

04/12/2023 Inventive Designers – The output innovators

3

About me

• Nick Van den Bleeken• R&D Manager at Inventive Designers• Member of the XForms WG at W3C

04/12/2023 Inventive Designers – The output innovators

4

Survey

• Who is not using source control?• SVN?• CVS?• Git?

04/12/2023 Inventive Designers – The output innovators

5

What is Git?

• Distributed Version Control System• Scalable and Fast• Non-linear, custom workflows– Subversion-Style Workflow– Integration Manager Workflow– Dictator and Lieutenants Workflow–…

04/12/2023 Inventive Designers – The output innovators

6

Git and Eclipse

• EGit: Eclipse Team Provider for Git• JGit: lightweight Java library implementing

Git

• Eclipse is moving to Git as SCM (ETA end 2010)

04/12/2023 Inventive Designers – The output innovators

7

Git vs SVN/CVS

Distributed (git)• Full local history• Cheap local branching• Fast• Rebase patches easily• Powerful merging

Centralized (CVS)• No• No• Slow• Patches go stale• Merging is a pain

04/12/2023 Inventive Designers – The output innovators

8

Git Basics (1)

Stores data as snapshots, not differences

(Images taken from http://progit.org/book)

04/12/2023 Inventive Designers – The output innovators

9

Git Basics (2)

• Nearly every operation is local• Git has integrity• Git generally only adds data

04/12/2023 Inventive Designers – The output innovators

10

Git Basics (3)

(Images taken from http://whygitisbetterthanx.com)

• The staging area

04/12/2023 Inventive Designers – The output innovators

11

Git Typical usage

Workingdirectory

Stagingarea

Local repo

remoterepo

git add

git commit

git push

git fetch

git checkout

git merge

04/12/2023 Inventive Designers – The output innovators

12

Branches and tags

(Images taken from http://progit.org/book)

• Branches– Creating a branch is quick (write 41

bytes)– Long running / Topic branches

• Tags– Lightweight tag

• branch that doesn’t change

– Annotated tag• Check summed• Tagger info• Tagging message• Optionally signed (GNU Privacy Guard)

04/12/2023 Inventive Designers – The output innovators

13

rebasemerge

Merging

• Git determines the best common ancestor to use for its merge base (different than CVS)

(Images taken from http://progit.org/book)

04/12/2023 Inventive Designers – The output innovators

14

rebase

Merging

• Git determines the best common ancestor to use for its merge base (different than CVS)

(Images taken from http://progit.org/book)

Inventive Designers – The output innovators

Demo

EGit and Gerrit

15

04/12/2023 Inventive Designers – The output innovators

16

Conclusion

• Git is very powerful• Git is scalable and fast• Git supports convenient branching and

merging• All revisions of every file are locally

available

• Git is the feature SCM of Eclipse

04/12/2023 Inventive Designers – The output innovators

17

EGit Features

git init / git clone git add git status git commit git diff(partial)

git fetch Git log(partial)

git mergegit rebase

git remote

git pull git push git stash git branch git tag(partial)

git checkout(partial)

git config git format-patch(partial)

git mv/git rm(partial) git reset

04/12/2023 Inventive Designers – The output innovators

18

Resources

• Git documentation http://git-scm.com/documentation

• Pro Git book http://progit.org/book

• EGit User Guide http://wiki.eclipse.org/EGit/User_Guide

• GitHub https://github.com/

Inventive Designers – The output innovators

Questions?

19

Recommended