Slide 1

Slide 1 text

VERSION CONTROL TOOL (VER. 3.1) A part of the Open Source Development Tools Using Git™ with EGit™ Eclipse™ Plug-in 1 By Koichi NAKAGAWA Enterprise Web Application Development Course (2)

Slide 2

Slide 2 text

Update Information • Ver. 3: Use Rocky Linux™ instead of CentOS™ as a Linux platform for Git Server. • Ver. 2 : Use JDK 11 instead of JDK 8 in all exercises. 2

Slide 3

Slide 3 text

Open Source Development Tools Version Control Tool (Git™) 3

Slide 4

Slide 4 text

EWA development course curriculum JSF with CDI JPA + JTA with CDI JAX-RS Application Architecture Design Patterns Eclipse IDE™ Version Control Tool with Git™ Build Tool with Apache Maven™ Payara Server™ Administration Windows 10™ + Linux (Rocky Linux™) Total EWA Development Exercise Jakarta Batch Java SE (Oracle JDK™/OpenJDK™) Required Skills to take courses Test Tool with JUnit5 PostgreSQL™ Administration 4 Object Oriented Development Methodology

Slide 5

Slide 5 text

Open Source Development Tools • Build Tool (Apache Maven™ with Eclipse™ Plug-in) • Version Control Tool (Git™ with Eclipse™ Plug-in) • Test Tool (JUnit5 with Eclipse™ Plug-in) 5

Slide 6

Slide 6 text

Trademarks Notice • Git™ and the Git™ logo( ) are either registered trademarks or trademarks of Software Freedom Conservancy, Inc., corporate home of the Git Project, in the United States and/or other countries. • Apache™ Subversion® and the Apache™ Subversion® logo( ) are either registered trademarks or trademarks of the Apache Software Foundation in the United States and/or other countries.. • Eclipse IDE for Enterprise Java Developers™, the Eclipse IDE for Enterprise Java Developers™ logo( ) are trademarks of the Eclipse Foundation. • Eclipse GitTeam Provider™, Eclipse EGit™, EGit™ is trademark of the Eclipse Foundation. • Java™ is trademark of Oracle Corporation. 6

Slide 7

Slide 7 text

Assumption for this course • The trainees who take this course are required the following skills in advance • Oracle JDK/OpenJDK (Version: 11) • Eclipse IDE for Enterprise Java Developers (Version: 2021-09 (4.21.0)) • Build Tool Training Course 7

Slide 8

Slide 8 text

Objectives for this course • Learning the Git™ Version Control Tool, you will obtain the concepts of version control tool and how to operate it through EGit™ Eclipse™ plug-in for Git™. Additionally you will know how to set up the Git™ remote and local repositories. 8

Slide 9

Slide 9 text

Git™ Version Control Tool • Git™ Concepts • How to set up Git™ and its Repositories • How to use EGit™ Eclipse Plug-in 9

Slide 10

Slide 10 text

Git™ Concepts 10

Slide 11

Slide 11 text

Open Source Version Control Tools History • Historical Version Control Tools RCS Open-source, Local data model based version control system managing versions for each file. => Developers manage versions of their own files. Apache™ Subversion® Open-source, Centralized version control system managing versions for each file. => Developers use a shared single repository. Git™ Open-source, Distributed version control system managing versions for whole project files. => Faster to commit, No single point failure, available Offline. 11

Slide 12

Slide 12 text

Commit and Version Product.java (Ver.1) Product.java (Ver.2) Product.java (Ver.3) . . . Commit Commit Commit Local Repository Developer’s PC • Git™ – Source Code Management (SCM) -Version Control 12

Slide 13

Slide 13 text

Versioning Unit • Git™ –Versioning for a whole project src main java resources webapp site test java resources Project X Local Repository 1. Commit for a whole project X 2. An ID is assigned for a whole project 3. Retrieve a whole project X by ID 13

Slide 14

Slide 14 text

Tag feature • Git™ –Tag for a specific ID Project X Local Repository 1. Assign a tag for a specific ID 2. The tag is mapped to the ID 3. Retrieve a whole project X by tag ID:47834 ID:48342 ID:82349 ID:13843 ID:43589 COMMIT COMMIT COMMIT COMMIT COMMIT TAG TAG Rel. 1 Rel. 2 14

Slide 15

Slide 15 text

Branch feature • Git™ – Branch (1) ID:47834 ID:48342 ID:82349 ID:13843 ID:43589 ID:7364 ID:23442 ID:91349 New Branch Merge Branches “XYZ” Branch “ABC” Branch 15

Slide 16

Slide 16 text

Branch feature • Git™ – Branch (2) “master” branch “develop” branch “special” branch “hotfix” branch 16

Slide 17

Slide 17 text

Git™ Repositories • Git™ Repositories and Communications between Git™ Clients and Server Git™ Client PC Git™ Server Remote Repository Local Repository Git™ Client PC Local Repository . . . Server Push Pull Push Pull Access + Commit Access + Commit 17

Slide 18

Slide 18 text

Team Development • Each member of Development Team communicates with Git™ Server Development Team Member A1 Development Team Member A2 Development Team Member A3 Git™ Server Remote Repository Server push push pull pull pull - Source/Resource files push Development Team A Repository xxx Project for xxx.jar 18

Slide 19

Slide 19 text

Team Development • Development Teams communicate with Git™ Server Git™ Server Remote Repository Server push push pull pull pull push Development Team A Development Team B Development Team C Depend Depend Project for zzz.war Project for yyy.jar Project for xxx.jar Repository xxx yyy zzz 19

Slide 20

Slide 20 text

How to set up Git™ and its Repositories 20

Slide 21

Slide 21 text

EGit™ • EGit™(Git Plug-in for Eclipse) EGit™ is a Git Plug-in for Eclipse and bundled into Eclipse IDE for Enterprise Java and Web Developers™ 21

Slide 22

Slide 22 text

• Configure some items of EGit™ How to configure EGit™ Set Operator’s Name and Email address Generate RSA Key for SSH communication Choose “Committing” Dialog Menu’s Type 22

Slide 23

Slide 23 text

• Configuration Example of EGit™ Exercise to configure EGit™ Configuration Item Configuration Value Set Operator’s Name and Email address user.name: “TaroYamada” user.email: “[email protected]” Generate RSA Key for SSH communication Generate “RSA Key” providing any “Passphrase” Choose Committing Dialog Menu’s Type Choose “Staging View” or “Commit Dialog” 23 Exercise: Let’s configure EGit™ with the above information.

Slide 24

Slide 24 text

• Set Operator’s Name to “Taro Yamada” and Email address to “[email protected]” From “Window” menu, Select “Preferences” and “Preferences” dialog menu comes up. Then navigate to “Configuration” pane screen by selecting “Version Control (Team)”  “Git”  “Configuration”. Exercise to configure EGit™ Fill in correct email and name Set Operator’s Name and Email address 24 Key Value user.name Taro Yamada user.email [email protected]  Enter “user.name” and “user.email” as “Key” and Your Name and Email Address as “Value”.  Click “Apply and Close” button.

Slide 25

Slide 25 text

• Generate RSA Key for SSH communication On the “Preferences” dialog menu, navigate to “SSH2” pane screen by selecting “General”  “Network Connectivity”  “SSH2” Exercise to configure EGit™  Click “Key Management” tab.  Click “Generate RSA Key …” button.  Enter “Passphrase” and “Confirm passphrase” and click “Apply and Close” button.  If eclipse asked you if you want to create “.ssh” folder, please click “Yes” button. Generate RSA Key for SSH communication 25

Slide 26

Slide 26 text

• Choose “Staging View” or “Commit Dialog” for “Committing” Dialog Menu On the “Preferences” dialog menu, navigate to “Committing” pane screen by selecting “Preferences”  “Team”  “Git”  “Committing” Exercise to configure EGit™ Check or Uncheck Choose “Committing” Dialog Menu’s Type 26  Uncheck “Use Staging View to commit instead of Commit Dialog”, if you want to use “Commit Dialog” menu.  Otherwise, leave it as it is to use “Staging View” for committing.

Slide 27

Slide 27 text

Eclipse IDE for Enterprise Java Developer™ EGit™ Plug-in and Git™ Server • EGit™: Eclipse Git Plug-in + Git™ Server EGit™ PC Git™ Server Remote Repository Local Repository Eclipse IDE for Enterprise Java Developer™ EGit™ PC Local Repository . . Server Push Pull Push Pull Access + Commit Access + Commit SSH, HTTP, etc. 27

Slide 28

Slide 28 text

How to set up Git™ and its Repository? • Procedures to set up Git™ and its Repository Set-up of Git™ Server Set-up of Git™ “bare” Remote Repository Set-up of Git™ Repositories with EGit™ 28

Slide 29

Slide 29 text

How to set up Git™ Server? • Procedure to set up the Git™ Server (1) Install Git™ product on Rocky Linux™ (2) Check firewall configuration for SSH communication and change it, if needed Set-up of Git™ Server Rocky Linux™ Git™ Product SSH (2)Configure Firewall for SSH service, if needed firewalld (1) Install Git™ product 29

Slide 30

Slide 30 text

How to set up Git™ Server? • How to set up Git™ Server 1. Install Git product on Rocky Linux 8.5 #dnf -y install git 2. Check whether “ssh” service is included as an allowed service to firewall # firewall-cmd --list-all public (active) target: default icmp-block-inversion: no interfaces: enp0s3 enp0s8 sources: services: cockpit dhcpv6-client postgresql ssh ports: 8082/tcp : rich rules: 3. (Option) If there is no SSH listed, configure firewall to include “ssh” service as an allowed service # firewall-cmd --add-service=ssh --runtime-to-permanent Procedure to install Git™ product on Rocky Linux™ 8.5 and check & set firewall configuration Set-up of Git™ Server Check if there is SSH service 30

Slide 31

Slide 31 text

Exercise to set up Git™ Server • Example of Set-up of Git™ Server (1) Install Git™ product on Rocky Linux™ 8.5. (2) As there is no firewall configuration for SSH communication, configure it. Set-up of Git™ Server Rocky Linux™ Git™ Product SSH (2)Configure Firewall for SSH service, as Firewall is not configured for SSH service (1) Install Git™ product firewalld 31 Exercise: Let’s set up Git™ Server with the above information.

Slide 32

Slide 32 text

Exercise to set up Git™ Server • How to set up Git™ Server 1. Install Git product on Rocky Linux™ 8.5 #dnf -y install git 2. Check whether “ssh” service is included as an allowed service to firewall # firewall-cmd --list-all public (active) target: default icmp-block-inversion: no interfaces: enp0s3 enp0s8 sources: services: cockpit dhcpv6-client postgresql ssh ports: 8082/tcp : rich rules: 3. As there is no SSH listed, configure firewall to include “ssh” service as an allowed service # firewall-cmd --add-service=ssh --runtime-to-permanent Procedure to install Git™ product on Rocky Linux™ 8.5 and check firewall configuration Set-up of Git™ Server 32

Slide 33

Slide 33 text

How to set up “bare” Remote Repository? • Example of Git™ “bare” Remote Repository on Git™ Server (1) Create Git™ User on Git™ Server (2) Create “bare” Git™ repository on Git™ Server Set-up of Git™ “bare” Remote Repository Rocky Linux™ Git™ Product SSH Git™ “bare” Remote Repository Git™ User firewalld 33

Slide 34

Slide 34 text

How to set up “bare” Remote Repository? • How to make Git™ “bare” Remote Repository on Git™ Server 1. Create an Git User and set Password for the user (These Git User and Password are used to configure EGit™ later) #useradd [Git User] #passwd [Git User] 2. Create Git “bare” Repository #mkdir [Repository top folder] #cd [Repository top folder] #git init --bare [Repository name]  Git™ “bare” Repository folder is created #cd .. #chown -R [Git User]:[Git Group] [Repository top folder]  Change the owner of Git™ folders and files Procedure to make Git™ “bare” Remote Repository on Git™ Server Set-up of Git™ “bare” Remote Repository 34

Slide 35

Slide 35 text

Exercise to set up “bare” Remote Repository? • Example of Git™ “bare” Remote Repository on Git™ Server (1) Create “git” as a Git™ User in Rocky Linux™ 8.5. (2) Create Git™ “bare” Repository named “projects.git” under “/var/lib/git” folder. Set-up of Git™ “bare” Remote Repository Rocky Linux™ Git™ Product SSH Git™ “bare” Repository: “/var/lib/git/projects.git” Git™ User: “git” firewalld 35 Exercise: Let’s set up Git™ “bare” Remote Repository with the above information.

Slide 36

Slide 36 text

Exercise to set up “bare” Remote Repository? • How to make Git™ “bare” Remote Repository on Git™ Server 1. Create an Git User and set Password for the user (These Git User and Password are used to configure EGit™ later) #useradd git #passwd git  Keep in mind the password you set here. 2. Create Git “bare” Repository #mkdir /var/lib/git #cd /var/lib/git #git init --bare projects.git #cd .. #chown -R git:git git Procedure to make Git™ “bare” Remote Repository on Rocky Linux™ 8.5 Set-up of Git™ “bare” Remote Repository 36

Slide 37

Slide 37 text

How to set-up Git™ Repositories with EGit™? • How to set-up Git™ Remote/Local Repositories with EGit™ Typical 3 ways to set-up Git™ Repositories with EGit™ (Eclipse™ Git Plug-in) Set-up of Git™ Repositories with EGit™ Typical 3 ways to set-up Git™ Repositories 1. Create a new project to Git™ Repositories from scratch 2. Import a project existing in Git™ Remote repository 3. Add a new project to existing Git™ Repositories Repository xxx yyy zzz Add a new project 37

Slide 38

Slide 38 text

How to set-up Git™ Repositories with EGit™? • How to set up Git™ Repositories for a Eclipse project of “projectX” with EGit™ 3 Ways to set up Git™ Repositories with EGit™ Eclipse™ Plug-in on Eclipse™ 1. Create new Git™ Repositories for a project 2. Import a project existing in Git™ Remote repository 3. Add a project to existing Git™ Repositories Not Existed /projects.git Local Repository Remote Repository Not Existed /projects.git/ projectX /repository/ projectA /projects.git/ projectA Only the bare repository is created. Set-up of Git™ Repositories with EGit™ /repository/ projectX /ws1/ projectX /projects.git/ projectX /projects.git/ projectX /repository2/ projectX /repository/ projectA projectX /ws1/ projectX /projects.git/ projectA projectX /ws2/ projectX 38

Slide 39

Slide 39 text

How to create new Git™ Repositories? • Step1: Convert an Eclipse™ project into a Git™ managed project on the “master” branch in Local Repository • Step2: Commit the Git™ managed project on the Local “master” branch • Step3: Push the committed Git™ project on the Local “master” branch to Remote Repository • Step4: Configure Push To Upstream • Step5: Configure Fetch From Upstream 1. Create new Git™ Repositories for a project (Summary) Not Existed /projects.git Local Repository Remote Repository /repository/ projectX /projects.git/ projectX /projects.git/ projectX Set-up of Git™ Repositories with EGit™ /ws1/ projectX Only the bare repository is created. /repository/ projectX /repository/ projectX /repository/ projectX 39 /projects.git/ projectX /repository/ projectX

Slide 40

Slide 40 text

Procedure to create new Git™ Repositories 1) Convert an Eclipse project into a Git™ managed project on the “master” branch in Local Repository - In Project Explorer, right click on the target project and navigate to “Configure Git Repository” dialog screen by selecting “Team”  “Share Project …”. - Click “Create …” button next to Repository field on “Configure Git Repository” pane screen, and “Create a Git Repository” dialog screen comes up and enter or select “[Local Repository Folder Path]” as “Repository directory” and confirm that “master” is “Default branch name” and click “Finish” button on “Create a New Git Repository” pane screen. - Confirm the result and click “Finish” button on “Configure Git Repository” pane screen of “Configure Git Repository” dialog screen. 1. Create new Git™ Repositories for a project (Operations Summary) Set-up of Git™ Repositories with EGit™ 40

Slide 41

Slide 41 text

Procedure to create new Git™ Repositories 2) Commit the Git™ managed project on the Local “master” branch for the first time - In Project Explorer, confirm the “>” mark next to the target project and right click on the project and navigate to “Git Staging” pane screen or “Commit Changes” dialog screen by selecting “Team”  “Commit …”. [Using “Staging View”] - Click “ ” icon for “Unstaged Changes” list to move all files into “Staged Changes” list to be committed on “Git Staging” pane screen. -Fill in the “Commit Message” field and click “Commit” button on “Git Staging” pane screen and confirm that “>” mark next to the project has disappeared in the Project Explorer. [Using “Commit Dialog”] - Fill in the “Commit Message” field and check all Git™ managed files and click “Commit” button on “Commit Changes to repository” pane screen of “Commit Changes” dialog screen and confirm that “>” mark next to the project is disappeared in Project Explorer. 1. Create new Git™ Repositories for a project (Operations Summary) Set-up of Git™ Repositories with EGit™ 41

Slide 42

Slide 42 text

Procedure to create new Git™ Repositories 3) Push the Local “master” branch to the Remote Repository - In Project Explorer, right click on the target project and navigate to “Push Branch master” dialog screen by selecting “Team”  “Push Branch ‘master’ …”. - Enter “origin” in “Remote name” field. Enter “ssh://[User Id]@[Host Name][Repository Path]” in URI field and enter password for git user in “Password” field and check the checkbox of “Store in Secure Store” and click “Preview >” button on “Destination Git Repository” pane screen and “Push to branch in remote” pane screen comes up. - Confirm that “Destination” is set “master” as its “Branch” and “Configure upstream to push and pull” is checked and “Merge” is selected as “When pulling” and then click “Preview >” button on “Push to branch in remote” pane screen. “Push Confirmation” pane screen comes up. - Select “master -> master [new branch]” and click “Push” button on “Push Confirmation” pane screen. Once the “Push Results” dialog screen appears, check it and click “Close” button. 1. Create new Git™ Repositories for a project (Operations Summary) Set-up of Git™ Repositories with EGit™ 42

Slide 43

Slide 43 text

Procedure to create new Git™ Repositories 4) Configure Push to Upstream - In Project Explorer, right click on the target project, and navigate to “Configure Push” dialog screen by selecting “Team”  “Remote” “Configure Push to Upstream…”. - Click “Advanced…” button on “Configure push for remote ‘origin’” pane screen and “Push Ref Specifications” pane screen comes up. - Click “All Branches”, “All Tags” buttons and confirm that the following two entries were added in “Specifications for push” list. -refs/heads/*:refs/heads/* -refs/tags/*:refs/tags/* - Enable “Force Update” for both entries, and click “Finish” button. - Confirm new list of “Ref mappings” on “Configure push for remote ‘origin’” pane screen. -refs/heads/*:refs/heads/* -refs/tags/*:refs/tags/* - Click “Save” button. 1. Create new Git™ Repositories for a project (Operations Summary) Set-up of Git™ Repositories with EGit™ 43

Slide 44

Slide 44 text

Procedure to create new Git™ Repositories 5) Configure Fetch from Upstream - In Project Explorer, right click on the target project and navigate to “Configure Fetch” dialog screen by selecting “Team”  “Remote”  “Configure Fetch from Upstream…”. - Click “Advanced…” button on “Configure fetch for remote ‘origin’” pane screen and “Fetch Ref Specifications” pane screen comes up. - Click “All Tags” buttons on “Fetch Ref Specification” dialog screen and confirm that the following entries were shown in “Specifications for fetch” list. - refs/heads/*:refs/remotes/origin/* - refs/tags/*:refs/tags/* - Enable “Force Update” for both entries, and click “Finish” button. - Confirm new list of “Ref mappings” on “Configure fetch for remote ‘origin’” pane screen. - refs/heads/*:refs/remotes/origin/* - refs/tags/*:refs/tags/* - Click “Save” button. 1. Create new Git™ Repositories for a project (Operations Summary) Set-up of Git™ Repositories with EGit™ 44

Slide 45

Slide 45 text

Exercise to create new Git™ Repositories (1) • Sample to set up Git™ Repositories for a new Eclipse project of “simple” with EGit™ 1. Create new Git™ Repositories for a project (Exercise) Not Existed /projects.git Local Repository Remote Repository Only the bare repository is created. Set-up of Git™ Repositories with EGit™ /repository/ simple /ws1/ simple /projects.git/ simple Git Folder: /var/lib/git Git User: git Branch: “master” Folder: “ws1” Branch: “master” Folder: “repository” Git Folder: C:\Users\\git 45 Exercise: Let’s create a new project to Git™ Repositories from scratch with the above information. Local Repository Remote Repository Eclipse Workspace Branch: “master” Folder: “projects.git”

Slide 46

Slide 46 text

• Convert an Eclipse project into a project in Git™ Local Repository In Project Explorer, right click on “simple” project and navigate to “Configure Git Repository” dialog screen by selecting “Team”  “Share Project …”. Exercise to create new Git™ Repositories (1) 1. Create new Git™ Repositories for a project (1-1) Set-up of Git™ Repositories with EGit™ 46

Slide 47

Slide 47 text

• Convert an Eclipse project into a project on the “master” branch in Git™ Local Repository Click “Create …” button next to Repository field on “Configure Git Repository” pane screen, and “Create a Git Repository” dialog screen comes up. Enter or select a Local “Repository directory” like “C:\Users\\git\repository” and confirm that “master” is “Default branch name” and click “Finish” button on “Create a New Git Repository” pane screen. Exercise to create new Git™ Repositories (1) 1. Create new Git™ Repositories for a project (1-2) Set-up of Git™ Repositories with EGit™ 47

Slide 48

Slide 48 text

• Convert an Eclipse project into a project on the “master” branch in Git™ Local Repository Confirm the result and click “Finish” button on “Configure Git Repository” pane screen. Exercise to create new Git™ Repositories (1) 1. Create new Git™ Repositories for a project (1-3) Set-up of Git™ Repositories with EGit™ 48

Slide 49

Slide 49 text

• Commit the project for the first time In Project Explorer, confirm the “>” mark next to the “simple” project. Right click on “simple” project and navigate to “Git Staging” pane screen or “Commit Changes” dialog screen by selecting “Team”  “Commit …”. Exercise to create new Git™ Repositories (1) 1. Create new Git™ Repositories for a project (2-1) Set-up of Git™ Repositories with EGit™ 49

Slide 50

Slide 50 text

• Commit the project for the first time Click “ ” icon for “Unstaged Changes” list to move all files into “Staged Changes” list to be committed on “Git Staging” pane screen. Exercise to create new Git™ Repositories (1) 1. Create new Git™ Repositories for a project with “Staging View” (2-2-1) Set-up of Git™ Repositories with EGit™ 50

Slide 51

Slide 51 text

• Commit the project for the first time Fill in the “Commit Message” field and click “Commit” button on “Git Staging” pane screen.  Confirm that “>” mark next to “simple” project has disappeared in the Project Explorer. Exercise to create new Git™ Repositories (1) 1. Create new Git™ Repositories for a project with “Staging View” (2-2-2) Set-up of Git™ Repositories with EGit™ 51 Taro Yamada [email protected]

Slide 52

Slide 52 text

• Commit the project for the first time  Fill in the “Commit Message” field and check all Git™ managed files and click “Commit” button on “Commit Changes to repository” pane screen of “Commit Changes” dialog screen.  Confirm that “>” mark next to “simple” project is disappeared in Project Explorer. Exercise to create new Git™ Repositories (1) 1. Create new Git™ Repositories for a project with “Commit Dialog” (2-2) Set-up of Git™ Repositories with EGit™ 52

Slide 53

Slide 53 text

• Push the Local “master” branch to the remote repository In Project Explorer, right click on “simple” project and navigate to “Push Branch master” dialog screen by selecting “Team”  “Push Branch ‘master’ …”. Exercise to create new Git™ Repositories (1) 1. Create new Git™ Repositories for a project (3-1) Set-up of Git™ Repositories with EGit™ 53

Slide 54

Slide 54 text

• Push “master” branch to the remote repository Enter “origin” in “Remote name” field. Enter “ssh://[email protected]/var/lib/git/projec ts.git” in URI field and enter password for git user in “Password” field and check the checkbox of “Store in Secure Store” and click “Preview >” button on “Destination Git Repository” pane screen. “Push to branch in remote” pane screen comes up. Exercise to create new Git™ Repositories (1) ssh://[email protected]/var/lib/git/projects.git 1. Create new Git™ Repositories for a project (3-2) Set-up of Git™ Repositories with EGit™ 54 192.168.56.104

Slide 55

Slide 55 text

• Push “master” branch to the remote repository Confirm that “Destination” is set “master” as its “Branch” and “Configure upstream to push and pull” is checked and “Merge” is selected as “When pulling” and then click “Preview >” button on “Push to branch in remote” pane screen. “Push Confirmation” pane screen comes up. Exercise to create new Git™ Repositories (1) 1. Create new Git™ Repositories for a project (3-3) Set-up of Git™ Repositories with EGit™ 55

Slide 56

Slide 56 text

• Push “master” branch to the remote repository Select “master -> master [new branch]” and click “Push” button on “Push Confirmation” pane screen. Once the “Push Results” dialog screen appears, check it and click “Close” button. Exercise to create new Git™ Repositories (1) 1. Create new Git™ Repositories for a project (3-4) Set-up of Git™ Repositories with EGit™ 56

Slide 57

Slide 57 text

• Configure Push to Upstream In Project Explorer, right click on the “simple” project, and navigate to “Configure Push” dialog screen by selecting “Team”  “Remote”  “Configure Push to Upstream…”. Exercise to create new Git™ Repositories (1) 1. Create new Git™ Repositories for a project (4-1) Set-up of Git™ Repositories with EGit™ 57

Slide 58

Slide 58 text

• Configure Push to Upstream Click “Advanced…” button on “Configure push for remote ‘origin’” pane screen and “Push Ref Specifications” pane screen comes up. Click “All Branches”, “All Tags” buttons and confirm that the following two entries were added in “Specifications for push” list. -refs/heads/*:refs/heads/* -refs/tags/*:refs/tags/* Enable “Force Update” for both entries, and click “Finish” button. Exercise to create new Git™ Repositories (1) 1. Create new Git™ Repositories for a project (4-2) Set-up of Git™ Repositories with EGit™ 58

Slide 59

Slide 59 text

• Configure Push to Upstream Confirm new list of “Ref mappings” on “Configure push for remote ‘origin’” pane screen. -refs/heads/*:refs/heads/* -refs/tags/*:refs/tags/* Click “Save” button. Exercise to create new Git™ Repositories (1) 1. Create new Git™ Repositories for a project (4-3) Set-up of Git™ Repositories with EGit™ 59

Slide 60

Slide 60 text

• Configure Fetch from Upstream In Project Explorer, right click on the “simple” project and navigate to “Configure Fetch” dialog screen by selecting “Team”  “Remote”  “Configure Fetch from Upstream…”. Exercise to create new Git™ Repositories (1) 1. Create new Git™ Repositories for a project (5-1) Set-up of Git™ Repositories with EGit™ 60

Slide 61

Slide 61 text

• Configure Fetch from Upstream Click “Advanced…” button on “Configure fetch for remote ‘origin’” pane screen and “Fetch Ref Specifications” pane screen comes up. Click “Add All Tags Spec” buttons on “Fetch Ref Specification” dialog screen. Confirm that the following entries were shown in “Specifications for fetch” list. - refs/heads/*:refs/remotes/origin/* - refs/tags/*:refs/tags/* Enable “Force Update” for both entries, and click “Finish” button. Exercise to create new Git™ Repositories (1) 1. Create new Git™ Repositories for a project (5-2) Set-up of Git™ Repositories with EGit™ 61

Slide 62

Slide 62 text

• Configure Fetch from Upstream Confirm new list of “Ref mappings” on “Configure fetch for remote ‘origin’” pane screen. - refs/heads/*:refs/remotes/origin/* - refs/tags/*:refs/tags/* Click “Save” button. Exercise to create new Git™ Repositories (1) 1. Create new Git™ Repositories for a project (5-3) Set-up of Git™ Repositories with EGit™ 62

Slide 63

Slide 63 text

How to import Git™ Remote Repository? • Step1: Import from Remote Repository to Local Repository and Eclipse™ Workplace • Step2: Configure Push To Upstream • Step3: Configure Fetch From Upstream Not Existed /projects.git/ projectX Local Repository Remote Repository /repository2/ projectX /projects.git/ projectX 2. Import a project existing in Git™ Remote repository (Summary) /repository2/ projectX /projects.git/ projectX Set-up of Git™ Repositories with EGit™ /ws2/ projectX 63 /repository2/ projectX /projects.git/ projectX

Slide 64

Slide 64 text

Procedure to import Git™ Remote Repository 1) Create a new exercise workspace - Navigate to “Eclipse IDE Launcher” dialog screen by selecting “File”  “Switch Workspace”  “Other…” and fill in the new workspace folder path of “[New Workspace Name]” and click “Launch” button on “Select a directory as workspace” pane screen. Then Eclipse IDE restarts with the new workplace. 2) (Option) Configure Installed JRE [If JDK11 has not been selected yet] - Select “Window”  “Preferences” and “Preferences” dialog screen comes up and select “Java”  “Installed JREs” and click “Add …” button on the “Installed JREs” pane screen. - Select “Standard VM” and click “Next >” button on “JRE Type” pane screen and click “Directory …” button and select an installed JDK home directory on “JRE Definition” pane screen and confirm the new list of “JRE system libraries” and click “Finish” button. - Check the added JDK entry from “Installed JREs” list on the “Installed JREs” pane screen and click “Apply and Close” button. 2. Import a project existing in Git™ Remote Repository (Operations Summary) Set-up of Git™ Repositories with EGit™ 64

Slide 65

Slide 65 text

Procedure to import Git™ Remote Repository 3) Import an existing project from a Remote Repository into a newly created Local Repository folder - In Project Explorer, click “Import projects…” link to navigate to “Import” dialog screen. - Select “Git”  “Projects from Git” in “Select an import wizard” field and click “Next >” button on “Select” pane screen. - Select “Clone URI” and click “Next >” button on “Select Repository Source” pane screen. - Enter “ssh://[User Id]@[Host Name][Repository Path]” in URI field. And Enter password for “git” user and click the checkbox of “Store in Secure Store” and click “Next >” button on “Source Git Repository” pane screen. - Confirm “master” branch is shown and the checkboxes for it is checked and click “Next >” button on “Branch Selection” pane screen. - Confirm the Git Local Repository Path like “[Local Repository Folder Path]” in “Directory” field of “Destination” and “master” as “Initial branch” and “origin” as “Remote name” and click “Next >” button on “Local Destination” pane screen. - Confirm “Importing existing Eclipse projects” is selected as “Wizard for project import” and click “Next >” button on “Select a wizard to use for importing projects” pane screen. - Confirm the target project is selected and click “Finish” button on “Import Projects” pane screen. 2. Import a project existing in Git™ Remote Repository (Operations Summary) Set-up of Git™ Repositories with EGit™ 65

Slide 66

Slide 66 text

Procedure to import Git™ Remote Repository 4) Configure Push to Upstream - In Project Explorer, right click on the target project, and navigate to “Configure Push” dialog screen by selecting “Team”  “Remote” “Configure Push to Upstream…”. - Click “Advanced…” button on “Configure push for remote ‘origin’” pane screen and “Push Ref Specifications” pane screen comes up. - Click “All Branches”, “All Tags” buttons and confirm that the following two entries were added in “Specifications for push” list. -refs/heads/*:refs/heads/* -refs/tags/*:refs/tags/* - Enable “Force Update” for both entries, and click “Finish” button. - Confirm new list of “Ref mappings” on “Configure push for remote ‘origin’” pane screen. -refs/heads/*:refs/heads/* -refs/tags/*:refs/tags/* - Click “Save and Push” button and confirm the push results and click “Close” button on “Push Results” dialog screen. 2. Import a project existing in Git™ Remote Repository (Operations Summary) Set-up of Git™ Repositories with EGit™ 66

Slide 67

Slide 67 text

Procedure to import Git™ Remote Repository 5) Configure Fetch from Upstream - In Project Explorer, right click on the target project and navigate to “Configure Fetch” dialog screen by selecting “Team”  “Remote”  “Configure Fetch from Upstream…”. - Click “Advanced…” button on “Configure fetch for remote ‘origin’” pane screen and “Fetch Ref Specifications” pane screen comes up. - Click “All Tags” buttons on “Fetch Ref Specification” dialog screen and confirm that the following entries were shown in “Specifications for fetch” list. - refs/heads/*:refs/remotes/origin/* - refs/tags/*:refs/tags/* - Enable “Force Update” for both entries, and click “Finish” button. - Confirm new list of “Ref mappings” on “Configure fetch for remote ‘origin’” pane screen. - refs/heads/*:refs/remotes/origin/* - refs/tags/*:refs/tags/* - Click “Save” button. 2. Import a project existing in Git™ Remote Repository (Operations Summary) Set-up of Git™ Repositories with EGit™ 67

Slide 68

Slide 68 text

Exercise to import Git™ Remote Repository (2) • Sample to set up Git™ Repositories by importing a Eclipse project of “simple” with EGit™ Local Repository Remote Repository Set-up of Git™ Repositories with EGit™ 2. Import a project existing in Git™ Remote Repository (Exercise) Not Existed /projects.git/ simple /projects.git/ simple /repository2/ simple “master” branch Branch: “master” Folder: “repository2” /ws2/ simple Branch: “master” Folder: “ws2” Git Folder: /var/lib/git/ Git User: git Git Folder: C:\Users\\git 68 Exercise: Let’s import a project existed in Git™ Remote Repositories with the above information. Remote Repository Local Repository Eclipse Workspace Branch: “master” Folder: “projects.git”

Slide 69

Slide 69 text

• Create a new exercise workspace named “ws2”  Navigate to “Eclipse IDE Launcher” dialog screen by selecting “File”  “Switch Workspace”  “Other…”  Fill in the new workspace folder path of “ws2” and click “Launch” button on “Select a directory as workspace” pane screen.  Eclipse IDE restarts with the new workspace. Exercise to set up Git™ and its Repository (2) 2. Import a project existing in Git™ Remote Repository (1) 69 C:\Users\\eclipse-workspace\ws2 Set-up of Git™ Repositories with EGit™

Slide 70

Slide 70 text

• (Option) Configure Installed JRE (1) [If JDK11 has not been selected yet]  Select “Window”  “Preferences” and “Preferences” dialog screen comes up.  Select “Java”  “Installed JREs” and click “Add …” button on the “Installed JREs” pane screen. Exercise to set up Git™ and its Repository (2) 70 2. Import a project existing in Git™ Remote Repository (2-1) Set-up of Git™ Repositories with EGit™

Slide 71

Slide 71 text

• (Option) Configure Installed JRE (2) [If JDK11 has not been selected yet]  Select “Standard VM” and click “Next >” button on “JRE Type” pane screen.  Click “Directory …” button and select an installed JDK home directory on “JRE Definition” pane screen.  Confirm the new list of “JRE system libraries” and click “Finish” button. Exercise to set up Git™ and its Repository (2) 71 2. Import a project existing in Git™ Remote Repository (2-2) Set-up of Git™ Repositories with EGit™

Slide 72

Slide 72 text

• (Option) Configure Installed JRE (3) [If JDK11 has not been selected yet]  Check the added JDK entry from “Installed JREs” list on the “Installed JREs” pane screen.  Click “Apply and Close” button. Exercise to set up Git™ and its Repository (2) 72 2. Import a project existing in Git™ Remote Repository (2-3) Set-up of Git™ Repositories with EGit™

Slide 73

Slide 73 text

• Import an existing project in a Remote Repository In Project Explorer, click “Import projects…” link to navigate to “Import” dialog screen. Exercise to set up Git™ and its Repository (2) 2. Import a project existing in Git™ Remote Repository (3-1) Set-up of Git™ Repositories with EGit™ 73

Slide 74

Slide 74 text

• Import an existing project in a Remote Repository Select “Git”  “Projects from Git” in “Select an import wizard” field and click “Next >” button on “Select” pane screen. Exercise to set up Git™ and its Repository (2) 2. Import a project existing in Git™ Remote Repository (3-2) Set-up of Git™ Repositories with EGit™ 74

Slide 75

Slide 75 text

• Import an existing project in a Remote Repository Select “Clone URI” and click “Next >” button on “Select Repository Source” pane screen. Exercise to set up Git™ and its Repository (2) 2. Import a project existing in Git™ Remote Repository (3-3) Set-up of Git™ Repositories with EGit™ 75

Slide 76

Slide 76 text

• Import an existing project in a Remote Repository Enter “ssh://[email protected]/var/lib/git/pro jects.git” in URI field. And Enter password for “git” user and click the checkbox of “Store in Secure Store” on “Source Git Repository” pane screen. Click “Next >” button. Exercise to set up Git™ and its Repository (2) 2. Import a project existing in Git™ Remote Repository (3-4) Set-up of Git™ Repositories with EGit™ 76 192.168.175.100 ssh://[email protected]/var/lib/git/projects.git

Slide 77

Slide 77 text

• Import an existing project in a Remote Repository Confirm “master” branch is shown and the “Tag fetching strategy” checkbox for “When fetching a commit, also fetch its tags” is checked on “Branch Selection” pane screen. Click “Next >” button. Exercise to set up Git™ and its Repository (2) 2. Import a project existing in Git™ Remote Repository (3-5) Set-up of Git™ Repositories with EGit™ 77

Slide 78

Slide 78 text

• Import an existing project in a Remote Repository Set the Git Local Repository Path like “C:\Users\\git\repository2” in “Directory” field of “Destination” and confirm “master” as “Initial branch” and “origin” as “Remote name” are selected on “Local Destination” pane screen. Click “Next >” button. Exercise to set up Git™ and its Repository (2) 2. Import a project existing in Git™ Remote Repository (3-6) Set-up of Git™ Repositories with EGit™ 78

Slide 79

Slide 79 text

• Import an existing project in a Remote Repository Confirm “Importing existing Eclipse projects” is selected as “Wizard for project import” on “Select a wizard to use for importing projects” pane screen. Click “Next >” button. Exercise to set up Git™ and its Repository (2) 2. Import a project existing in Git™ Remote Repository (3-7) Set-up of Git™ Repositories with EGit™ 79

Slide 80

Slide 80 text

• Import an existing project in a Remote Repository Confirm the target project is selected and click “Finish” button on “Import Projects” pane screen. Exercise to set up Git™ and its Repository (2) 2. Import a project existing in Git™ Remote Repository (3-8) Set-up of Git™ Repositories with EGit™ 80

Slide 81

Slide 81 text

• Configure Push to Upstream In Project Explorer, right click on the “simple” project, and navigate to “Configure Push” dialog screen by selecting “Team”  “Remote”  “Configure Push to Upstream…”. Exercise to set up Git™ and its Repository (2) 2. Import a project existing in Git™ Remote Repository (4-1) Set-up of Git™ Repositories with EGit™ 81

Slide 82

Slide 82 text

• Configure Push to Upstream  Click “Advanced…” button on “Configure push for remote ‘origin’” pane screen and “Push Ref Specifications” pane screen comes up.  Click “All Branches”, “All Tags” buttons and confirm that the following two entries were added in “Specifications for push” list. -refs/heads/*:refs/heads/* -refs/tags/*:refs/tags/* Enable “Force Update” for both entries, and click “Finish” button.  “Configure push for remote ‘origin’” pane screen comes up. Exercise to set up Git™ and its Repository (2) 2. Import a project existing in Git™ Remote Repository (4-2) Set-up of Git™ Repositories with EGit™ 82

Slide 83

Slide 83 text

• Configure Push to Upstream Confirm the new “Ref mappings” on “Configure push for remote ‘origin’” pane screen. -refs/heads/*:refs/heads/* -refs/tags/*:refs/tags/* Click “Save and Push” button. Confirm the push results on “Push Results” dialog screen. Click “Close” button. Exercise to set up Git™ and its Repository (2) 2. Import a project existing in Git™ Remote Repository (4-3) Set-up of Git™ Repositories with EGit™ 83

Slide 84

Slide 84 text

• Configure Fetch from Upstream In Project Explorer, right click on the “simple” project and navigate to “Configure Fetch” dialog screen by selecting “Team”  “Remote”  “Configure Fetch from Upstream…”. Exercise to set up Git™ and its Repository (2) 2. Import a project existing in Git™ Remote Repository (5-1) Set-up of Git™ Repositories with EGit™ 84

Slide 85

Slide 85 text

• Configure Fetch from Upstream Click “Advanced…” button on “Configure fetch for remote ‘origin’” pane screen. Click “All Tags” button on “Fetch Ref Specification” pane screen. Confirm that the following entries were shown in “Specifications for fetch”. -refs/heads/*:refs/heads/* -refs/tags/*:refs/tags/* Enable “Force Update” for both entries. Click “Finish” button. Exercise to set up Git™ and its Repository (2) 2. Import a project existing in Git™ Remote Repository (5-2) Set-up of Git™ Repositories with EGit™ 85

Slide 86

Slide 86 text

• Configure Fetch from Upstream Confirm the new “Ref mappings” on “Configure fetch for remote ‘origin’” pane screen. -refs/heads/*:refs/heads/* -refs/tags/*:refs/tags/* Click “Save” button. Exercise to set up Git™ and its Repository (2) 2. Import a project existing in Git™ Remote Repository (5-3) Set-up of Git™ Repositories with EGit™ 86

Slide 87

Slide 87 text

How to add a project to existing Repositories? • Step1: Convert a Eclipse project into a Git™ managed project in the Local Repository • Step2: Push the project to Remote Repository /projects.git/ projectA Local Repository Remote Repository /repository/ projectA, projectX /projects.git/ projectA 3. Add a project to existing Git™ Repositories (Summary) /repository/ projectA /repository/ projectA, projectX /projects.git/ projectA, projectX Set-up of Git™ Repositories with EGit™ /exercise1/ projectX 87

Slide 88

Slide 88 text

How to add a project to existing Repositories? 1) Switch Workspace back to an existing one - In Project Explorer, right click on project  Switch Workspace  C:\Users\\workspace\ 2) Convert a new project to a Git™ managed project under an existing Local Repository - In Project Explorer, right click on the target project and navigate to “Share Project” dialog screen by selecting “Team”  “Share Project …”. - Click drop-down button of Repository field on “Configure Git Repository” pane screen and select an existing Local Repository like “C:\Users\\git\repository\.git” and confirm the Target Location of the target project and click “Finish” button. - Confirm the branch name of the Git™ managed project is “master” with the Project Explorer. 3. Add a project to existing Git™ Repositories (Operations Summary) Set-up of Git™ Repositories with EGit™ 88

Slide 89

Slide 89 text

How to add a project to existing Repositories? 3) Commit & Push the project to the Remote Repository - In Project Explorer, right click on the target project and navigate to “Git Staging” pane screen or “Commit Changes” dialog screen by selecting “Team”  “Commit…”. [Using “Staging View”] - Click “ ” icon for “Unstaged Changes” list to move all files into “Staged Changes” list to be committed on “Git Staging” pane screen and fill in the “Commit Message” field and click “Commit and Push” button. - Confirm Push Results on “Pushed to repository - origin” pane screen and click “Close” button. - Confirm that “>” mark next to the target project is disappeared in Project Explorer. [Using “Commit Dialog”] - Fill in the “Commit Message” field on “Commit Changes to Git Repository” pane screen and check all Git™ managed files and click “Commit and Push” button. - Confirm the Destination and click “Preview” button on “Push to branch in remote” pane screen. - Confirm the expected push result and click “Push” button on “Push Confirmation” pane screen and confirm the push result and click “Close” button on “Pushed to ssh://…” dialog screen. - Confirm that “>” mark next to “simple2” project is disappeared in Project Explorer. 3. Add a project to existing Git™ Repositories (Operations Summary) Set-up of Git™ Repositories with EGit™ 89

Slide 90

Slide 90 text

Exercise to set up Git™ and its Repository (3) • Sample to set up Existing Git™ Repositories for a new Eclipse project of “simple2” with EGit™ Local Repository Remote Repository Set-up of Git™ Repositories with EGit™ 3. Add a project to existing Git™ Repositories (Exercise) /projects.git/ simple /repository/ simple “master” branch “master” branch /repository/ simple simple2 /ws1/ simple2 /projects.git/ simple simple2 Branch: “master” Folder: “ws1” Branch: “master” Folder: “repository” Git Folder: /var/lib/git/ Git User: git Git Folder: C:\Users\\git 90 Exercise: Let’s add a project to existing Git™ Repositories with the above information. Local Repository Remote Repository Branch: “master” Folder: “projects.git” Eclipse Workspace

Slide 91

Slide 91 text

• Switch the workspace back to “ws1” Select “File”  “Switch Workspace”  “C:\Users\\workspace\ws1”. Eclipse IDE restarts with the new workspace. Exercise to set up Git™ and its Repository (3) 3. Add a project to existing Git™ Repositories (1) Set-up of Git™ Repositories with EGit™ 91

Slide 92

Slide 92 text

• Convert an Eclipse project into a Git™ managed project in the existing Local Repository In Project Explorer, right click on “simple2” project and navigate to “Share Project” dialog screen by selecting “Team”  “Share Project …”. Exercise to set up Git™ and its Repository (3) 3. Add a project to existing Git™ Repositories (2-1) Set-up of Git™ Repositories with EGit™ 92

Slide 93

Slide 93 text

• Convert an Eclipse project into a Git™ managed project in the existing Local Repository Click drop-down button of Repository field on “Configure Git Repository” pane screen and select an existing Local Repository like “C:\Users\\git\repository\.git” Confirm the Target Location of the project “simple2” Click “Finish” button. Confirm the branch name of the Git™ managed project is “master” with the Project Explorer. Exercise to set up Git™ and its Repository (3) 3. Add a project to existing Git™ Repositories (2-2) Set-up of Git™ Repositories with EGit™ 93

Slide 94

Slide 94 text

• Commit & Push the project to the Remote Repository In Project Explorer, right click on “simple2” project and navigate to “Git Staging” pane screen or “Commit Changes” dialog screen by selecting “Team”  “Commit…”. Exercise to set up Git™ and its Repository (3) 3. Add a project to existing Git™ Repositories (3-1) Set-up of Git™ Repositories with EGit™ 94

Slide 95

Slide 95 text

• Commit & Push the project to the Remote Repository Click “ ” icon for “Unstaged Changes” list to move all files into “Staged Changes” list to be committed on “Git Staging” pane screen. Exercise to set up Git™ and its Repository (3) Set-up of Git™ Repositories with EGit™ 95 3. Add a project to existing Git™ Repositories with “Staging View” (3-2-1)

Slide 96

Slide 96 text

• Commit & Push the project to the Remote Repository Fill in the “Commit Message” field and click “Commit and Push” button on “Git Staging” pane screen. Exercise to set up Git™ and its Repository (3) Set-up of Git™ Repositories with EGit™ 96 Taro Yamada [email protected] 3. Add a project to existing Git™ Repositories with “Staging View” (3-2-2)

Slide 97

Slide 97 text

• Commit & Push the project to the Remote Repository Confirm Push Results on “Pushed to repository - origin” pane screen. Click “Close” button. Confirm that “>” mark next to “simple2” project is disappeared in Project Explorer. Exercise to set up Git™ and its Repository (3) Set-up of Git™ Repositories with EGit™ 97 3. Add a project to existing Git™ Repositories with “Staging View” (3-2-3) Repository: ssh://[email protected]/var/lib/git/projects.git

Slide 98

Slide 98 text

• Commit & Push the project to the Remote Repository  Fill in the “Commit Message” field on “Commit Changes to Git Repository” pane screen.  Check all Git™ managed files.  Click “Commit and Push” button.  Confirm the Destination and click “Preview” button on “Push to branch in remote” pane screen. Exercise to set up Git™ and its Repository (3) 3. Add a project to existing Git™ Repositories with “Commit Dialog” (3-2-1) Set-up of Git™ Repositories with EGit™ 98 Second Commit

Slide 99

Slide 99 text

• Commit & Push the project to the Remote Repository  Confirm the expected push result and click “Push” button on “Push Confirmation” pane screen.  Confirm the push result and click “Close” button on “Pushed to ssh://…” dialog screen.  Confirm that “>” mark next to “simple2” project is disappeared in Project Explorer. Exercise to set up Git™ and its Repository (3) 3. Add a project to existing Git™ Repositories with “Commit Dialog” (3-2-2) Set-up of Git™ Repositories with EGit™ 99 Repository: ssh://[email protected]/var/lib/git/projects.git

Slide 100

Slide 100 text

How to use EGit™ Eclipse Plug-in 100

Slide 101

Slide 101 text

How to use EGit™? • Typical Operations with EGit™ on Eclipse 2021-06 (4.20.0) Commit Check Commit History Branch/Tag Pull/Push from/to Git™ Server Compare with Past Commit/Tag Checkout Past Commit/Tag 101

Slide 102

Slide 102 text

Branch • Commit some modifications on a Branch How to use EGit™? Commit Branch Get Project(s) Commit Project(s) : Commit Points Finish Modification (HEAD) (NEW HEAD) Modify Source Files Modify Source Files 102

Slide 103

Slide 103 text

• Commit some modifications on “master” Branch in the Local Repository Exercise of Commit with EGit™ Commit Committed Local Repository Branch: “master” Folder: “repository” /repository/ simple2 Modified App.java Committed App.java 103 Exercise: After modification of a Java source file, let’s commit it on the “master” branch in the Local Repository with the above information. /ws1/ simple2 Eclipse Workspace Branch: “master” Folder: “ws1” Commit Modification

Slide 104

Slide 104 text

• Modify App.java of simple2 project and save it (1) Exercise of Commit with EGit™ Commit Insert 104 Save

Slide 105

Slide 105 text

• Commit some modifications on “master” Branch in the Local Repository (2-1) In Project Explorer, right click on “simple2” project and navigate to “Staging View” pane or “Commit Changes” dialog screen by selecting “Team”  “Commit…”. Exercise of Commit with EGit™ Commit 105

Slide 106

Slide 106 text

• Commit some modifications on “master” Branch in the Local Repository (2-2-1) Fill in the “Commit Message” field and check modified Git™ managed files and click “Commit” button. Confirm that the “>” mark next to the project “simple2” is disappeared and all the projects in the same repository have the up-arrow mark with a figure of one(1) next to the branch name is added in Project Explorer. Exercise of Commit with EGit™ Commit Note: This operation commits only to the Local Repository. When you click “Commit and Push” button instead of “Commit”, Commit is done to both the Local Repository and the Remote Repository. 106 Add a Message. Using Staging View

Slide 107

Slide 107 text

• Commit some modifications on “master” Branch in the Local Repository (2-2-2) Fill in the “Commit Message” field and check modified Git™ managed files and click “Commit” button on “Commit Changes” dialog screen. Confirm that the “>” mark next to the project “simple2” is disappeared and all the projects in the same repository have the up-arrow mark with a figure of one(1) next to the branch name is added in Project Explorer. Exercise of Commit with EGit™ Commit Note: This operation commits only to the Local Repository. When you click “Commit and Push” button instead of “Commit”, Commit is done both to the Local Repository and the Remote Repository. 107 Using Commit Dialog Add a Message.

Slide 108

Slide 108 text

• Commit Ids in Commit History (When, Who, Branches, Parent Id, Child Id, …) How to use EGit™? Check Commit History : Commit Ids (HEAD) Commit History Commit Commit Commit Commit (Branch A, C) 108 Commit (Branch B)

Slide 109

Slide 109 text

• Check Commit History of a project Exercise of Commit History with EGit™ Local Repository Branch: “master” Folder: “repository” /repository/ simple2 Check Commit History Id: 6744c54 Id: 4e724aa 109 Exercise: Let’s check Commit History of the project “simple2”. Remote Repository Remote Name: “origin” Branch: “master” Folder: “projects.git” /projects.git/ simple2 /ws1/ simple2 Eclipse Workspace Branch: “master” Folder: “ws1”

Slide 110

Slide 110 text

• Check Commit History on “master” Branch in the Local Repository (1-1) In Project Explorer, right click on “simple2” project and navigate to “History” pane by selecting “Team”  “Show in History”. Exercise of Commit History with EGit™ Check Commit History 110

Slide 111

Slide 111 text

• Check Commit History on “master” Branch in the Local Repository (1-2) In “History” pane, “Commit History” is shown. Exercise of Commit History with EGit™ Check Commit History Commit ID 111

Slide 112

Slide 112 text

How to use EGit™? Branch/Tag “master” Branch “develop” Branch “special” Branch “hotfix” Branch 112

Slide 113

Slide 113 text

• Local and Remote Branches How to use EGit™? Branch/Tag Local “A” Branch (HEAD) Commit Commit Remote “A” Branch Local Repository Remote Repository Synchronize Branch “A” <> • “Pull” once a day (Typically the first thing in the morning) • “Commit” + “Push” soon once Tests are passed. Push Pull Commit Push Pull Push Push Push 113

Slide 114

Slide 114 text

• Check Local and Remote Branches in Commit History • Check Current Branch with Project Explorer Exercise of Branch/Tag with EGit™ (1) Branch/Tag Local Repository Branch: “master” Folder: “repository” /repository/ simple2 /projects.git/ simple2 Remote Repository Remote Name: “origin” Branch: “master” Folder: “projects.git” Id: 6744c54 Id: 4e724aa Id: 4e724aa 114 Exercise: Let’s check Commit History of the project “simple2” in Local and Remote Branches, and Current Branch with Project Explore. /ws1/ simple2 Eclipse Workspace Branch: “master” Folder: “ws1”

Slide 115

Slide 115 text

• Check Local and Remote Branches in Commit History In “History” pane, confirm Local Branch and Remote Branch Exercise of Branch/Tag with EGit™ (1) Local Branch Branch/Tag 115 Remote Branch

Slide 116

Slide 116 text

• Check Current Branch in Project Explorer In Project Explore, confirm Current Branch Exercise of Branch/Tag with EGit™ (1) Branch/Tag Local Repository Name Current Branch 1 Commit is ready for pushing to Upstream 116

Slide 117

Slide 117 text

• Create New Branch (named “develop”) Exercise of Branch/Tag with EGit™ (2) Branch/Tag “master” Branch “develop” Branch Id: 6744c54 /repository/ simple2 Local Repository Branch: “master” Folder: “repository” Create New Branch 117 Exercise: Let’s create a New Branch named “develop”. /ws1/ simple2 Eclipse Workspace Branch: “master” Folder: “ws1” /repository/ simple2 Local Repository Branch: “develop” Folder: “repository” /ws1/ simple2 Eclipse Workspace Branch: “develop” Folder: “ws1”

Slide 118

Slide 118 text

• Create New Branch (1-1) In Project Explore, right click on “simple2” project and navigate to “Create Branch” dialog screen by selecting “Team”  “Switch To”  “New Branch…”. Exercise of Branch/Tag with EGit™ (2) Branch/Tag “master” branch 118

Slide 119

Slide 119 text

• Create New Branch (1-2) Enter “develop” in the Branch name field as New Branch and click “Finish” button on “Create a new branch in repository repository” pane screen. Exercise of Branch/Tag with EGit™ (2) Branch/Tag “master” branch as Source 119

Slide 120

Slide 120 text

• Check New Branch (1-3) Confirm New Branch in Project Explorer and Git History. Exercise of Branch/Tag with EGit™ (2) Branch/Tag Current Branch Local “develop” Branch 120

Slide 121

Slide 121 text

Id: cfbcf59 • Merge Branches Exercise of Branch/Tag with EGit™ (3) Branch/Tag “master” Branch “develop” Branch /repository/ simple2 Local Repository Branch: “master” Folder: “repository” Merge Branches 121 Exercise: Let’s modify the “develop” branch and merge it into the “master” branch. Id: 6744c54 Modify /ws1/ simple2 Eclipse Workspace Branch: “master” Folder: “ws1” /repository/ simple2 Local Repository Branch: “master” with “develop” Folder: “repository” /ws1/ simple2 Eclipse Workspace Branch: “master” with “develop” Folder: “ws1”

Slide 122

Slide 122 text

• Prepare for Merging Branches (1-1) Edit App.java of “simple2” project on “develop” Branch further and save it. Confirm “>” marks are added on affected project, source folders and file in Project Explorer. Exercise of Branch/Tag with EGit™ (3) Branch/Tag Add 122 Save

Slide 123

Slide 123 text

• Prepare for Merging Branches (1-2) Commit on the “develop” Branch by right clicking on “simple2” project and navigate to “Git Staging” pane screen or “Commit Changes” dialog screen by selecting “Team”  “Commit…” and select the updated file and set a commit message and click “Commit” button, but don’t click “Commit and Push” button. Confirm the “develop” Branch in Project Explore and Commit History. Exercise of Branch/Tag with EGit™ (3) Branch/Tag Id for “develop” Branch is different from Id for “master” Branch Current Branch 123

Slide 124

Slide 124 text

• Merge Branches (3)  In Project Explore, right click on “simple2” project and switch to “master” branch by selecting “Team”  “Switch To”  “master”.  Confirm that the current Branch is switched back to “master” in Project Explore. Exercise of Branch/Tag with EGit™ (3) Branch/Tag 124 Current Branch

Slide 125

Slide 125 text

• Merge Branches (4-1)  In Project Explore, right click on “simple2” project and navigate to “Merge ‘master’” dialog screen by selecting “Team”  “Merge…”. Exercise of Branch/Tag with EGit™ (3) Branch/Tag 125

Slide 126

Slide 126 text

• Merge Branches (4-2)  Select the Local “develop” Branch and click “Merge” button to merge the “develop” Branch to current “master” Branch on “Merge ‘master’” pane screen. Confirm the result and click “OK” button on “Merge Result” dialog screen. Exercise of Branch/Tag with EGit™ (3) Branch/Tag 126

Slide 127

Slide 127 text

• Merge Branches (4-3)  Confirm the “master” and “develop” Branches in Project Explore and Git History. Exercise of Branch/Tag with EGit™ (3) Branch/Tag Id for “develop” Branch is equal to Id for “master” Branch 127

Slide 128

Slide 128 text

• Create Tag on the Current “master” Branch Exercise of Branch/Tag with EGit™ (4) Branch/Tag “master” Branch “develop” Branch Id: cfbcf59 /repository/ simple2 Local Repository Branch: “master” Folder: “repository” Tag: 1.0 128 Exercise: Let’s create a Tag on the Current “master” Branch. /ws1/ simple2 Eclipse Workspace Branch: “master” Folder: “ws1” /repository/ simple2 Local Repository Branch: “master” Tag: “1.0” Folder: “repository”

Slide 129

Slide 129 text

• Create Tag on “master” Branch (1-1)  In Project Explore, right click on “simple2” project and navigate to “Create New Tag” dialog screen by selecting “Team”  “Advanced”  “Create Tag…”. Exercise of Branch/Tag with EGit™ (4) Branch/Tag “master” branch 129

Slide 130

Slide 130 text

• Create Tag on “master” Branch (1-2)  Fill in “Tag name” and “Tag message” fields and click “Create Tag” button on “Create New Tag on Branch ‘master’” pane screen. Check the created Tag in Commit History. Exercise of Branch/Tag with EGit™ (4) Branch/Tag Created Tag 130

Slide 131

Slide 131 text

• Push commits and tags on Local Branch to associated Remote Branch Exercise of Pull & Push with EGit™ (1) Pull/Push from/to Git™ Server Local Repository Branch: “master” Tag: “1.0” Folder: “repository” /repository/ simple2 /projects.git/ simple2 Remote Repository Remote Name: “origin” Branch: ”master” Tag: “1.0” Folder: “projects.git” Id: cfbcf59 Id: cfbcf59 Push Id: 4e724aa 131 Exercise: Let’s push commits and tags on Local Branch to the associated Remote Branch. /ws1/ simple2 Eclipse Workspace Branch: “master” Folder: “ws1”

Slide 132

Slide 132 text

• Push commits and tags to existing Remote Branch (1) Confirm the current status of Local and Remote Branches in Project Explore and Commit History. Exercise of Pull & Push with EGit™ (1) 2 Commits have not been pushed to Git™ Server yet Local “master” Branch Pull/Push from/to Git™ Server Remote “master” Branch Different Ids are pointed to. 132

Slide 133

Slide 133 text

• Push commits and tags to existing Remote Branch (2-1)  In Project Explore, right click on “simple2” project navigate to “Push Branch master” dialog screen by selecting “Team”  “Push Branch ‘master’ …”.  Check Source and Destination and Click “Preview >” button on “Push to branch in remote” pane screen. Exercise of Pull & Push with EGit™ (1) Pull/Push from/to Git™ Server 133

Slide 134

Slide 134 text

• Push commits and tags to existing Remote Branch (2-2) Confirm “Push” Preview and click “Push” button on “Push Confirmation” pane screen. Check the “Push” Results and click “Close” button on “Pushed Results ssh://…” dialog screen. Exercise of Pull & Push with EGit™ (1) Pull/Push from/to Git™ Server 134

Slide 135

Slide 135 text

• Push commits and tags to existing Remote Branch (2-3)  Confirm the result in Project Explore and Commit History. Exercise of Pull & Push with EGit™ (1) Pull/Push from/to Git™ Server All Commits have been pushed to Git™ Server Local and Remote “master” Branches point to the same Id 135

Slide 136

Slide 136 text

• Push new “develop” Branch to Remote Repository Exercise of Pull & Push with EGit™ (2) Pull/Push from/to Git™ Server Local Repository Branch: “develop” Folder: “repository” /repository/ simple2 /projects.git/ simple2 Remote Repository Remote Name: “origin” New Branch: ”develop” Folder: “projects.git” Id: cfbcf59 Push Id: cfbcf59 136 Exercise: Let’s push the “develop” Local Branch to the Remote Repository. /ws1/ simple2 Eclipse Workspace Branch: “develop” Folder: “ws1”

Slide 137

Slide 137 text

• Push new “develop” Branch to Remote Repository (1) Confirm the current status of “develop” branch in Project Explore and Commit History. Exercise of Pull & Push with EGit™ (2) Pull/Push from/to Git™ Server “develop” Branch exists only in the Local repository(There is no Remote “develop” Branch). Current Branch is “master”. 137

Slide 138

Slide 138 text

• Push new “develop” Branch to Remote Repository (2) In Project Explore, right click on “simple2” project and change Branch to “develop” by selecting “Team”  “Switch To”  “develop”. Exercise of Pull & Push with EGit™ (2) Pull/Push from/to Git™ Server 138 Branch is changed to “develop”.

Slide 139

Slide 139 text

• Push new “develop” Branch to Remote Repository (3-1) In Project Explore, right click on “simple2” project and navigate to “Push Branch develop” dialog screen by selecting “Team”  “Push Branch ‘develop’ …”. Check Source and Destination and click “Preview>” button on “Push to branch in remote” pane screen. Exercise of Pull & Push with EGit™ (2) Pull/Push from/to Git™ Server 139

Slide 140

Slide 140 text

• Push new “develop” Branch to Remote Repository (3-2)  Confirm the expected push result and click “Push” button on “Push Confirmation” pane screen.  Confirm the result and click “Close” button on “Push Results ssh://…” dialog screen.  Confirm the Remote “develop” Branch was created. Exercise of Pull & Push with EGit™ (2) Pull/Push from/to Git™ Server Local and Remote “develop” Branches point to the same Id 140 New Branch

Slide 141

Slide 141 text

• Pull and Import a new project from Remote Repository Exercise of Pull & Push with EGit™ (3) Pull/Push from/to Git™ Server Local Repository Branch: “master” Folder: “repository2” /repository2/ simple /projects.git/ simple simple2 Remote Repository Remote Name: “origin” Branch: ”master” Folder: “projects.git” Eclipse Workplace Branch: “master” Folder: “ws2” /ws2/ simple /repository2/ simple simple2 /ws2/ simple Pull /repository2/ simple simple2 /ws2/ simple simple2 Import There is no source file under /ws2, but only configuration for projects exists Old Version 141 Exercise: Let’s pull and import the “master” Branch from the Remote Repository. New Version Initial State Step. 1 Step. 2

Slide 142

Slide 142 text

• Switch the Eclipse™ workplace to “ws2” (1) Switch to “ws2” workspace by selecting “File”  “Switch Workspace”  “C:\Users\\eclipse-workspace\ws2”. Exercise of Pull & Push with EGit™ (3) Pull/Push from/to Git™ Server /ws2/ simple Eclipse Workplace Folder: “ws2” 142

Slide 143

Slide 143 text

• Pull the latest artifacts from remote repository (2) Right click on “simple” project and navigate to “Pull Result …” dialog screen by selecting “Team”  “Pull”. Check the Pull Result and click “Close” button. Exercise of Pull & Push with EGit™ (3) Pull/Push from/to Git™ Server /projects.git/ simple simple2 Pull /repository2/ simple simple2 /ws2/ simple Local Repository Branch: “master” Folder: “repository2” Remote Repository Remote Name: “origin” Branch: “ master” Folder: “projects.git” Eclipse Workplace Branch: “master” Folder: “ws2” Pull /ws2/ simple 143 Old simple project

Slide 144

Slide 144 text

• Import “simple2” from the local repository (3-1)  In Project Explorer, right click and navigate to “Import” dialog screen by selecting “Import”  “Import…”.  Select “Git” “Projects from Git” and click “Next>” button on “Select” pane screen. Exercise of Pull & Push with EGit™ (3) Pull/Push from/to Git™ Server /repository2/ simple simple2 /ws2/ simple simple2 Import Local Repository Branch: “master” Directory: “repository2” Eclipse Workplace Branch: “master” Directory: “ws2” 144

Slide 145

Slide 145 text

• Import “simple2” from the local repository (3-2)  Select “Existing local repository” and click “Next>” button on “Select Repository Source” pane screen.  Select the Local Repository “repository2[master]” and click “Next>” button on “Select a Git Repository” pane screen. Exercise of Pull & Push with EGit™ (3) Pull/Push from/to Git™ Server 145

Slide 146

Slide 146 text

• Import “simple2” from the local repository (3-3)  Select “Import existing Eclipse projects” and click “Next>” button on “Select a wizard to use for importing projects” pane screen.  Select “simple2” project and click “Finish” button on “Import Projects” pane screen. Exercise of Pull & Push with EGit™ (3) Pull/Push from/to Git™ Server 146

Slide 147

Slide 147 text

• Pull a new “develop” Branch from Remote Branch Exercise of Pull & Push with EGit™ (4) Pull/Push from/to Git™ Server Local Repository New Branch: “develop” Folder: “repository2” /repository2/ simple2 /projects.git/ simple2 Remote Repository Remote Name: “origin” Branch: “ develop” Folder: “projects.git” Id: c2c8e3d Id: faef3c8 /ws2/ simple2 Eclipse Workplace Branch: “ develop” Folder: “ws2” 147 Exercise: Let’s pull a new “develop” Branch from the Remote Repository.

Slide 148

Slide 148 text

• Pull a new “develop” Branch from Remote Branch (1) Check the current status of Branch and confirm that the Local “develop” Branch does NOT exist. Exercise of Pull & Push with EGit™ (4) Pull/Push from/to Git™ Server Current Branch is “master” “develop” Branch exists only in the Remote repository. 148

Slide 149

Slide 149 text

• Pull a new “develop” Branch from Remote Branch (2-1) In Project Explore, right click on “simple2” project and navigate to “Create Branch” dialog screen by selecting “Team”  “Switch To”  “New Branch…”. Exercise of Pull & Push with EGit™ (4) Pull/Push from/to Git™ Server 149

Slide 150

Slide 150 text

• Pull a new “develop” Branch from Remote Branch (2-2) Click “Select…” button on “Create a new branch in repository repository2” pane screen. Select “origin/develop” Branch and click “OK” button on “Select Source” dialog screen. Exercise of Pull & Push with EGit™ (4) Pull/Push from/to Git™ Server 150

Slide 151

Slide 151 text

• Pull a new “develop” Branch from Remote Branch (2-3) Confirm Source is changed to “origin/develop” and Branch name becomes “develop” and click “Finish” button on “Create a new branch in repository repository2” pane screen. Confirm Current Branch is “develop” and Local “develop” Branch was created. Exercise of Pull & Push with EGit™ (4) Pull/Push from/to Git™ Server 151 “develop” Branch was created in the Local repository. Current Branch is “develop”

Slide 152

Slide 152 text

• Pull Latest Version from Remote Branch Exercise of Pull & Push with EGit™ (5) Pull/Push from/to Git™ Server Local Repository Branch: “develop” Folder: “repository” /repository/ simple2 /projects.git/ simple2 Remote Repository Remote Name: “origin” Branch: “ develop” Folder: “projects.git” Id: 53ee3bf Pull Id: 53ee3bf Id: faef3c8 . . . Update Commit+Push Another Developer 152 Exercise: Let’s pull a new “develop” Branch from the Remote Repository. /ws1/ simple2 Eclipse Workplace Branch: “develop” Folder: “ws1” Local Repository Branch: “develop” Folder: “repository2” /repository2/ simple2 Id: 53ee3bf /ws2/ simple2 Eclipse Workplace Branch: “develop” Folder: “ws2”

Slide 153

Slide 153 text

• Pull Latest Version from Remote Branch (1) Modify the source file of “simple2” project on the Local “develop” Branch. Exercise of Pull & Push with EGit™ (5) Pull/Push from/to Git™ Server 153 Save

Slide 154

Slide 154 text

• Pull Latest Version from Remote Branch (2-1) Commit the modified project on the Local “develop” Branch and Push it to the Remote Repository. Exercise of Pull & Push with EGit™ (5) Pull/Push from/to Git™ Server 154

Slide 155

Slide 155 text

• Pull Latest Version from Remote Branch (2-2) Commit the modified project on the Local “develop” Branch and Push it to the Remote Repository. Exercise of Pull & Push with EGit™ (5) Pull/Push from/to Git™ Server 155

Slide 156

Slide 156 text

• Pull Latest Version from Remote Branch (3) Switch the Eclipse Workspace to “ws1”. Exercise of Pull & Push with EGit™ (5) Pull/Push from/to Git™ Server 156

Slide 157

Slide 157 text

• Pull Latest Version from Remote Branch (4) Confirm the current status of “develop” Branch and the latest Id is “cfbcf59”. Exercise of Pull & Push with EGit™ (5) Pull/Push from/to Git™ Server Current Branch is “develop” The Id for the Local “develop” Branch is “cfbcf59”. 157

Slide 158

Slide 158 text

• Pull Latest Version from Remote Branch (5-1) In Project Explore, right click on “simple2” project and navigate to “Pull Result for repository” dialog screen by selecting “Team”  “Pull”. Exercise of Pull & Push with EGit™ (5) Pull/Push from/to Git™ Server 158

Slide 159

Slide 159 text

• Pull Latest Version from Remote Branch (5-2) Confirm the result and click “Close” button. Confirm the latest Id is changed to “0f3ecea”. Exercise of Pull & Push with EGit™ (5) Pull/Push from/to Git™ Server 159 The new “develop” Id is changed to “0f3ecea”.

Slide 160

Slide 160 text

• Check the differences between Current Id (HEAD) and Specific Id/Tag How to use EGit™? Branch : Commit Points (HEAD) Commit Commit Commit Commit Commit Compare with Past Commit/Tag : Tags Compare 160

Slide 161

Slide 161 text

• Check the differences between Current Id (HEAD) and Specific Id Exercise to compare with Past Commit/Tag (1) Local Repository Branch: “develop” Folder: “repository” /repository/ simple2 Id: 0f3ecea (HEAD) Id: 0fbcf59 Check Differences Compare with Past Commit/Tag 161 Exercise: Let’s check the differences in source files between HEAD and the previous commit. /ws1/ simple2 Eclipse Workplace Branch: “develop” Folder: “ws1”

Slide 162

Slide 162 text

• Check the differences between Current Id (HEAD) and Specific Id (1-1)  In Project Explore, right click on “simple2” project and navigate to “Select a Commit” dialog screen by selecting “Compare With”  “Commit…”. Exercise to compare with Past Commit/Tag (1) Compare with Past Commit/Tag 162

Slide 163

Slide 163 text

• Check the differences between Current Id (HEAD) and Specific Id (1-2)  Select the target compared Id and click “Select” button on “4 commits in repository repository” pane screen.  Confirm Open Perspective Dialog menu and click “Yes” button on “Confirm Open Perspective” pane screen. Exercise to compare with Past Commit/Tag (1) Compare with Past Commit/Tag 163

Slide 164

Slide 164 text

• Check the differences between Current Id (HEAD) and Specific Id (2-1)  In Synchronize, confirm the different files are listed.  Right click on a different file and select “Open In Compare Editor” menu. Exercise to compare with Past Commit/Tag (1) Compare with Past Commit/Tag 164

Slide 165

Slide 165 text

• Check the differences between Current Id (HEAD) and Specific Id (2-2)  Confirm the different lines of the selected file. Exercise to compare with Past Commit/Tag (1) Compare with Past Commit/Tag 165

Slide 166

Slide 166 text

• Check the differences between Current Id (HEAD) and Specific Tag Exercise to compare with Past Commit/Tag (2) Local Repository Branch: “develop” Folder: “repository” /repository/ simple2 Id: 0f3ecea (HEAD) Tag: 1.0 Check Differences Compare with Past Commit/Tag 166 /ws1/ simple2 Eclipse Workplace Branch: “develop” Folder: “ws1” Exercise: Let’s check the differences in source files between HEAD and the commit tagged “1.0”.

Slide 167

Slide 167 text

• Check the differences between Current Id (HEAD) and Specific Tag (1-1)  In Project Explore, right click on project “simple2” and navigate to “Compare” dialog screen by selecting “Compare With”  “Branch, Tag or Reference…”. Exercise to compare with Past Commit/Tag (2) Compare with Past Commit/Tag 167

Slide 168

Slide 168 text

• Check the differences between Current Id (HEAD) and Specific Tag (1-2)  Select the target compared Tag and click “Compare” button on “Compare ‘simple2’ with a Branch, Tag, or Reference” pane screen.  Confirm Open Perspective Dialog menu and click “Yes” button on “Confirm Open Perspective” dialog screen. Exercise to compare with Past Commit/Tag (2) Compare with Past Commit/Tag 168

Slide 169

Slide 169 text

• Check the differences between Current Id (HEAD) and Specific Tag (2-1)  In Synchronize, confirm the different files are listed.  Right click on a different file and select “Open In Compare Editor” menu. Exercise to compare with Past Commit/Tag (2) Compare with Past Commit/Tag 169

Slide 170

Slide 170 text

• Check the differences between Current Id (HEAD) and Specific Tag (2-2)  Confirm the different lines of the selected file. Exercise to compare with Past Commit/Tag (2) Compare with Past Commit/Tag 170

Slide 171

Slide 171 text

• Checkout a Past Commit/Tag How to use EGit™? Branch : Commit Points (HEAD) Commit Commit Commit Commit Commit : Tags Checkout Checkout Past Commit/Tag Old Project Files 171

Slide 172

Slide 172 text

• Checkout a Past Tagged Commit Exercise to checkout a Past Tagged Commit Local Repository Branch: “develop” Folder: “repository2” /repository2/ simple2 Id: 0f3ecea (HEAD) Id: cfbcf59 Tag: 1.0 Checkout Past Commit/Tag Checkout 172 /ws1/ simple2 Eclipse Workplace Branch: “develop” Folder: “ws1” Exercise: Let’s check out source files of the project with the commit tagged “1.0”.

Slide 173

Slide 173 text

• Checkout a Past Tagged Commit (1) In Project Explorer, select “simple2” project. In History pane, right click on the target “1.0” Tag and navigate to “Select a Branch for Checkout” dialog screen by selecting “Check Out”. Exercise to checkout a Past Tagged Commit Checkout Past Commit/Tag 173

Slide 174

Slide 174 text

• Checkout a Past Tagged Commit (1) Select “ref/heads/master” and click “Checkout” button on “Select a Branch for Checkout” dialog screen. Confirm the target project was checked out. Exercise to checkout a Past Tagged Commit Checkout Past Commit/Tag Check Out 174 You can switch back to “HEAD” by switching to the “develop” branch

Slide 175

Slide 175 text

Exercise 175

Slide 176

Slide 176 text

Exercise1 • Create Git™ “bare” remote repository named “exercise.git” under a directory of “/var/lib/git” on Git™ Server. Rocky Linux 8.5 Git™ Product SSH “bare” repository: “/var/lib/git/exercise.git” Git™ User: “git” firewalld 176

Slide 177

Slide 177 text

Exercise2 • Set up Git™ repositories for a Eclipse project of “exercise1” with EGit™ Not Existed /exercise.git Local Repository Remote Repository Only the bare repository is created. /exercise/ exercise1 /ws1/exercise1 /exercise.git/ exercise1 Git Folder: /var/lib/git Git User: git Branch: “master” Folder: “ws1” Branch: “master” Folder: “exercise” Git Folder: C:\Users\\git /ws1/exercise1 Eclipse Workspace 177 Remote Name: “origin” Branch: “master” Folder: “exercise.git” Folder: “exercise.git” Folder: “ws1” Initial State After Exercise

Slide 178

Slide 178 text

• Create New Branch (named “develop”) Exercise3 (1) “master” Branch “develop” Branch Id: xxxxxxx /exercise/ exercise1 Local Repository Branch: “master” Folder: “exercise” Create New Branch 178 /ws1/ exercise1 Eclipse Workspace Branch: “master” Folder: “ws1” /exercise/ exercise1 Local Repository Branch: “develop” Folder: “exercise” /ws1/ exercise1 Eclipse Workspace Branch: “develop” Folder: “ws1”

Slide 179

Slide 179 text

• Update & Commit to “develop” Branch • Push to Remote Repository Exercise3 (2) “develop” Branch Update & Commit Id: yyyyy 179 /exercise.git/ exercise1 Remote Repository Remote Name: “origin” Branch: “develop” Folder: “exercise.git” Push /exercise/ exercise1 Local Repository Branch: “develop” Folder: “exercise” /ws1/ exercise1 Eclipse Workspace Branch: “develop” Folder: “ws1”

Slide 180

Slide 180 text

• Merge “develop” Branch to “master” Branch • Push to Remote Repository Exercise3 (3) “master” Branch “develop” Branch Merge Id: yyyyy 180 /exercise.git/ exercise1 Push /exercise/ exercise1 Local Repository Branch: “master” Folder: “exercise” /ws1/ exercise1 Eclipse Workspace Branch: “master” Folder: “ws1” Remote Repository Remote Name: “origin” Branch: “master” with “develop” Folder: “exercise.git” /exercise/ exercise1 Local Repository Branch: “master” with “develop” Folder: “exercise”

Slide 181

Slide 181 text

• Attach a Tag named “Release_1.2” to “master” Branch • Push to Remote Repository Exercise3 (4) “master” Branch Tag Release_1.2 181 /exercise.git/ exercise1 Push Remote Repository Remote Name: “origin” Branch: “master” with “develop” Tag: “Release_1.2” Folder: “exercise.git” /exercise/ exercise1 Local Repository Branch: “master” with “develop” Tag: “Release_1.2” Folder: “exercise” /exercise/ exercise1 Local Repository Branch: “master” with “develop” Tag: Nothing Folder: “exercise”