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.



Register for Bitbucket.



Create Private/Public repository



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.


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


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


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


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


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


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


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


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