2015-10-18

How to Configure BitBucket Git Repository in your Eclipse Environment? Git version control with Eclipse (EGit)



Bitbucket is a distributed version control system (DVCS) code hosting site that supports Mercurial and GitWith Mercurial and Git, your data is distributed by definition but you still need a place to share it and keep track of your development. That is where Bitbucket comes in.
You may need to check why I choose bitbucket over github.
Bitbucket provides a fully-featured environment for managing your development project, including a code repository, a wiki (naturally backed by Mercurial and Git – you can clone it), a powerful issue tracker and easy collaboration with others.
Simply put, Bitbucket takes the pain out of sharing code and lets you focus on what you do best: Code. Bitbucket offers both commercial plans and free accounts. It offers free accounts with an unlimited number of private repositories (which can have up to five users in the case of free accounts).

Here are quick steps to setup BitBucket Repository to you Eclipse Environment.

 

 Step-1

Register for Bitbucket.

 

Step-2

Create Private/Public repository

 

Step-3

On Overview page https://bitbucket.org/dashboard/overview, look for your repository information.
Bitbucket Dashboard Overview page
Mouse hover will give you Repository URL which we will use later to import project into Eclipse.

Step-4

Now let’s make Eclipse ready for Git.
  • Open Eclipse
  • Click on Help menu
  • Click Install New Software
Eclipse Install New Software

Step-5

Install eGit into Eclipse. Git version control with Eclipse (EGit) – Tutorial.  How to use bitBucket with EGit in Eclipse.
URL: http://download.eclipse.org/egit/updates
Eclipse - Add Repository

Step-6

Select Eclipse Git Team Provider and JGit form option and click next and finish install.
Eclipse Install Git

Step-7

Now Open Perspective and choose Git from list.
Eclipse Git Prospective

Step-8

Click Clone Repository Button
Clone Git Repository to Eclipse and Add to View

Step-9

Enter your Bitbucket URL and User Information as mentioned in below diagram. Click Next and Finish. No need to change other configuration in next window.
Clone Repository Options Page in Eclipse

Step-10

You should see your Bitbucket repository now in eclipse.
Checked Out Bitbucket repository in Eclipse

Step-11

Now you may want to import the project so you can work on the source code.
  1. Click
    1. ‘Windows’ >
    2. ‘Open Perspective’ >
    3. ‘Resource’
  2. Click
    1. ‘File’ >
    2. ‘Import’ >
    3. ‘Git’ >
    4. ‘Projects from Git’ >
    5. ‘Existing local repository’ >
    6. ‘Select a Git Repository’ >
    7. ‘Import as General Project’ >
    8. ‘Next’ >
    9. ‘Finish’
  3. The code should then appear in your ‘Project Explorer’ window as a normal project
  4. Now make changes to your file as you want
  5. Look at ‘Git Staging’ view to see your changed files and Click ‘Commit and Push
Git Staging View in Eclipse
Do let me know if you encounter any issue while setting this up. Now what? Now setup SmartGit with your BitBucket repository to do all kind of commit, put, etc GIT operations.

No comments:

Post a Comment