X
03Apr

Integration of Git into Eclipse IDE

The Eclipse IDE provides support for the Git version control system. You can easily perform the necessary Git commands like staging, commit, merge, pull and push via the Eclipse IDE. Git is pre-installed in Eclipse IDE. If git is not installed by default, go to Help > Eclipse Marketplace and install git explicitly.

1. Git Cloning Process: -

  1. This tutorial describes the usage of Git with version 4.4 of the Eclipse IDE. The home page for the Eclipse IDE appears as follows.

        1

 

2. In the Eclipse Home page, we won’t find any git related options. So, we need to select ‘Window > Show View > Other’ option to open ‘Show View’ dialog box then type ‘Git’ in search bar. Now, you will see ‘Git’ options as below.

 

2

3

3. From ‘Show View’ dialog box, select the necessary options such as ‘Git Repositories, Git Staging’ as shown below to display git options in the Eclipse Home Page.

4

4. To Clone a remote repository using Git URL, Select the ‘Clone a Git Repository’ option from ‘Git Repositories’ and fill out the required details like URL, authentication etc. as follows, then select ‘Next > Next > Finish’ option.

5

5. Once the cloning is finished, the remote repository will display as follows in ‘Git Repositories’ Section.

6

6. Now, we need to import the same git repository into ‘Package Explorer’ section. Right click in ‘Package Explorer’ section > select ‘Import’ option and type ‘Git’ in the search bar, then select ‘Projects from Git > Next > Existing Local Repository > Next > Select a git repository > Next > Finish’ option and the project appears as follows in the ‘Package Explorer’ section.

7

2. Git Operations (Commit, Push, Pull and Fetch): -

  1. Using the ‘Git Staging’ view, we can commit and push the changes into Local/Remote repository. All the new/modified files appear in the ‘Unstaged changes’ area. Drag all files into the ‘Staged Changes’ area, write a meaningful commit message and press the ‘Commit’ button.

8

2. Let's make some changes like modifying the output message in the 'HelloWorld.java' file (e.g. inserted Canarys Output line), as shown below. Drag the file into the ‘Staged Changes’ area, write a meaningful commit message and press the ‘Commit and Push’ button. Also, check the changes reflected in the remote repository page below.

9

10

3. Git operations (such as commit, pull, push and fetch etc.) can also be performed from ‘Git Repositories’ section as shown below. Right click on your repository of ‘Git Repositories’ and select the appropriated operation.

11

 

4.  Basic team operations (such as commit, pull, push and fetch etc.) can also perform from ‘Package Explorer’ section as shown below. Once you have placed a project under version control you can start using team operations on your project. The team operations are available via right-click on your project or file in ‘Project Explorer’ section.

12

 

5. Pulling changes made by other project team members. The image below shows changes that are pulled from remote repository. Go to 'Package Explorer' section and Select ‘Team > Pull’ Options.

13

3. Creating and Switching Git Branches: -

1. To create a new branch, Right-click on your project and select ‘Team > Switch To... > New Branch’ option then give the branch name as well. You can also create branches in the ‘Git Repositories’ view.

14

 

2. To switch the branches, Right-click on your project and select ‘Team > Switch To… > master’ (select the branch which you want to switch). You can also switch branches in the ‘Git Repositories’ view.

 

     15

 

4. Solving Conflicts:

Whenever two team members of the team change the same file, conflicts may occur. So, we need to fix such conflicts manually.

1.  Let’s take an example of ‘HelloWorld.Java’ file only. Suppose Person A makes changes and Person B also makes changes to the same file, then there can be conflicts as shown below.

16a

Let’s take an example of ‘HelloWorld.Java’ file only. Suppose Person A makes changes and Person B also makes changes to the same file, then there can be conflicts as shown below.

16b

2. After the changes have been manually merged/fixed, save the file to mark the conflicts as resolve and commit the merge commit from ‘Team > Commit’ option.

17

Related

Implementing Security to your DevOps Pipeline

Hi all, today in this post I'm gonna talk about "Implementing Security to your DevOps Pipel...

Read More >

Webinar - The process of version migration from older versions of Navision to NAV 2013 R2

Please watch LIVE RECORDING Video of the webinar session below which took place on 5th Jun...

Read More >

Exclusive CxO Roundtable at C-SOaP addresses

img{ display:block; } #outlook a{ padding:0; } body{ width:100% !important; } body{ ma...

Read More >

Building an Outlook 2010 Add In Using C#.NET With Visual Studio 2010

How to build an outlook 2010 Add In using C#.Net and Visual Studio 2010?In this post, I’l...

Read More >

HTML Parser

Are you looking for any HTML Parser?Want to traverse through HTML DOM elements?Want to read properti...

Read More >

How to write custom code in NAV 2013 R2 Report layout design?

You may want to add custom code to the RDLC report to do more actions than what's already provid...

Read More >

Building Xamarin.Android application in C#

OverviewIn this article we’ll look at how to create, deploy, and run a Xamarin.Android applica...

Read More >

New Features in Sql Server 2008

Introduction:Many new developer features were introduced in SQL Server 2008 database. This tutorial ...

Read More >

Canarys is a finalist for 2014 Microsoft ALM partner of the year award from INDIA

Bangalore, Karnataka, India — May 29, 2014 — Canarys, today announced it has been named ...

Read More >

What’s new: Extension for Microsoft Dynamics NAV 2016

We all have seen the situation where we need to put in lot of efforts to modify the standard NAV obj...

Read More >

Share

Comments

Hi Shaik Rabbani,It's so nice to see your Blog which is very important and useful for Java Developers along with other Devlopers as well. It must be appreciated. But I would like to suggest one thing that is technology is getting updated day by day so suggestions is if you would have shoot and uploaded demo video on this title that would be an added Wantage to it. If you would have use colours for text that would have another adwatange. Rest of the things is good. Keep it up.
4/4/2020 9:21:35 PM | Reply

Post a Comment

  • Recent
  • Popular
  • Tag
  • The Ansible Architecture

    Ansible is an open source, IT automation tool. It can configure systems, deploy software, and orchestrate more advanced IT tasks such as continuous deployments or zero downtime rolling updates. In thi...
  • Subversion (Centralized Version Control System)

    Version control system is a repository of files, often the files for the source code of computer programs with monitored access. They are essential for any form of distributed, collaborative developme...
  • Volume management in Kubernetes

    Since pods created in k8s are ephemeral, we are able to get the data as long as pods are alive, but if pods are terminated data stored in it completely lost and it cannot be get back, for that we need...
  • LDAP Integration with Sonatype Nexus

    Sonatype Nexus supports the Repository Manager integration with various active directory systems for authentication, such as Microsoft Exchange / Active Directory, OpenLDAP, ApacheDS, and others. In o...
Tags
Monthly Archive
Subscribe
Name

Contact Us
  • *
  • *