Salesforce is popular CRM software that helps businesses keep track of their customer relationships. In order to make development on Salesforce more efficient, it is important to use a source control system.
In this article, we will discuss the different options for source control for Salesforce development and how to set up each one.
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. git-scm.com
There are a few ways to set up Git for Salesforce development:
1) Use the Force.com IDE plugin
2) Use the Mavensmate plugin
3) Use the Eclipse IDE with the Force.com plugin
4) Use the command line
To set up the Force.com IDE plugin, first download and install the latest version of Eclipse from eclipse.org. Once Eclipse is installed, launch it and go to Help > Install New Software. In the “Work with” field, enter “http://adcdownload.adobe.com/bin/live/force-ide/force-ide-release38.apk” and press Enter. Select the checkbox next to “Force.com IDE” and click Next. Click Next again on the following screen and then Finish to install the plugin. Once the installation is complete, restart Eclipse.
The Mavensmate plugin can be installed in two ways:
1) Use the Eclipse Marketplace
2) Install from source
To install Mavensmate via the Eclipse Marketplace, launch Eclipse and go to Help > Eclipse Marketplace:
In the search field, enter “mavensmate” and press Enter. Select the checkbox next to “MavensMate for Salesforce” and click Install. Click Confirm and then Finish on the following screen. Once the installation is complete, restart Eclipse.
To install Mavensmate from source, first clone the repository from GitHub:
https://github.com/joeferraro/MavensMate-Desktop/tree/master/Eclipse%20Plugin. Then, in Eclipse, go to File > Import. Select “Existing Projects into Workspace” and click Next. Click Browse and navigate to the location of the cloned repository. Select the projects you want to import and click Finish. Once the projects are imported, go to Window > Preferences and search for “mm”. Select “MavensMate” from the list and enter your Mavensmate credentials.
The command line is a powerful way to interact with Salesforce directly. To set up the Force.com CLI, first download it from here: https://force-cli.herokuapp.com/. Unzip the downloaded file and open a terminal window (Mac) or command prompt (Windows). Navigate to the unzipped directory and enter the following command:
$ cd force-cli
This will output the help text for the Force.com CLI. To login to your org, enter the following command:
$ force login -i <org_alias>
Replace <org_alias> with the alias of your org. You will be prompted for your username and password. Once you are logged in, you can run commands against your org. For a full list of commands, enter the following:
$ Force -h
Bitbucket is a web-based version control repository hosting service owned by Atlassian, used for source code and development projects that use either Mercurial or Git revision control systems. bitbucket.org
To set up a Bitbucket repository for Salesforce development, first create an account on Bitbucket if you don’t already have one. Once you are logged in, click the + icon in the top left corner and select “Create repository” from the dropdown menu. Enter a name for your repository and select “Git” as the type. Click Create repository.
On the following page, you will see the commands to initialize your local repository and push your changes to Bitbucket. Follow the instructions on this page to set up your local repository and push your first commit.
Once your repository is set up, you can add files and folders to it just like any other folder on your computer. To push changes to Bitbucket, simply enter the following command in your terminal window or command prompt:
$ git push
You will be prompted for your Bitbucket username and password. Enter your credentials and press Enter. Your changes will be pushed to Bitbucket.
To pull changes from Bitbucket, enter the following command:
$ git pull
This will retrieve any changes that have been made to the repository since your last commit and incorporate them into your local copy.
In this article, we have covered three essential tools for Salesforce development: the Force.com IDE, the Mavensmate plugin, and the Bitbucket version control system. These tools will help you streamline your development process and make it easier to collaborate with others on your team.