Set up your development environment
Clone this wiki locally
In order to work with the SugarCRM development team and contribute code to us, you will need to setup your local development environment to use git and build the application on your local machine. Here are the steps you will need to take to do this.
Complete the Contribution Agreement
A great guide for this is the Git Crash Course.
Fork the SugarCRM repository
You can do this entire from the github website. See Forking Git to learn how
Setup Git on your local machine
Follow the guide produced by Github, which provides detailed instructions on setting up git and connecting to Github from your local machine. If you are on Windows, check out the note here to avoid issues with line endings on your local repository.
Clone your repository on your local machine
With git setup and your Github fork created, we can now clone the git repository to our local machine. Change to the directory you wish to do this at, and issue this command to clone the sugarcrm_dev repository ( changing username for your username in Github )
$ git clone email@example.com:username/sugarcrm_dev.git
Now that we have cloned the repository locally, we next need to setup the remote repositories that this repository will reference. By default, git creates the origin remote, which points to the fork you created on github ( https://github.com/_username_/sugarcrm_dev ) . However, in order to stay up to date with the changes to the parent repository ( https://github.com/sugarcrm/sugarcrm_dev ) you'll want to setup the upstream remote as well. Here's how:
$ cd sugarcrm_dev $ git remote add upstream git://github.com/sugarcrm/sugarcrm_dev.git $ git fetch upstream
Now anytime you want to update a remote branch it's a simple process. Just change to the branch you want to update from the upstream ( for example, the master branch ) and then issue the commands below:
$ git checkout master $ git fetch upstream $ git merge upstream/master $ git push origin master
These commands will pull down the latest changes to the upstream repo to your local repo, then merge the changes into your local clone's master branch, and finally push those changes back up to your fork's repository on Github.
Once you have setup your environment, you are ready to Provide a code contribution to SugarCRM.