How to configure Bitbucket version control in Eclipse for Salesforce project?

BitBucket is a web-based hosting service for projects that use use either the Mercurial or Git revision control systems. It is similar to Github. BitBucket is an Atlassian product which integrates very well with JIRA, a popular project and issue-managing appYou can get a free account from https://bitbucket.org.

We need to download and install Git from https://git-scm.com/downloads before we start to configure BitBucket. Git installation will provide GitBash command line utility.

Please follow the steps below to store a Salesforce project in BitBucket. We will use the BitBucket account for ApexCoder https://bitbucket.org/apexcoder .

  • Sign in to BitBucket and create repository
  • Repository > Create repository > Repository name (e.g. Salesforce)

bb1

  • Clone our repository (https://bitbucket.org/apexcoder/Salesforce) in our local machine
    • Create a folder Workspace in your computer root folder.
    • Open Git Bash command prompt from All Programs > Git Bash.
    • Navigate to the C:\Workspaces from Git Bash.

bb2

bb3

  • Verify if Salesforce folder is created in C:\Workspace

bb4

bb5

  • Commit project to BitBucket Salesforce repository
    • In Eclipse right click on project, Click Team > Share Project.

bb6

  • Select Git from the Share Project screen and click next.

bb7

  • Click create in Configure Git Repository screen

bb8

  • Select Salesforce path as shown below and click finish

bb9

  • Click finish to connect local Salesforce project folder with BitBucket Salesforce repository.

bb10

  • Right click on the Eclipse project > Team >Add to Index. This step will add all the files to be committed.

bb11

  • Right click on the project and click Commit. Enter commit message. Click on Commit and Push.
  • Click Next and enter your BitBucket Username and Password

bb12

  • Click finish on Push Confirmation screen

bb13

  • Verify if your Salesforce project is committed to BitBucket

bb14

  • If you make change to your Salesforce project, you can repeat the steps to store the latest revision of your project in BitBucket. If new files are created make sure you perform Add to Index Step.
  • We can see the commits we make from BitBucket.

bb15

  • In case you need to revert your changes after last commit, use Team > Reset

 
Author:

Ajomon Joseph AJOMON JOSEPH
Senior Salesforce Architect
In Connect me on LinkedIn
twitter Follow me on Twitter @apexcoder
blogger Subscribe to my blog https://apexcoder.com
email Email me ajomon@apexcoder.com

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s