4

I use mavensmate with sublime editor for salesforce project. I was told it is a good practise to have each sandbox links to a Github branch, but wasn't told how to.

when I set up each sandbox in Mavensmate, it needs an empty folder, which means each sandbox per folder. but how could I sync each folder with a Github branch ?

The best working manner would be when I save in Sublime, it will save to my Salesforce sandbox. and when I commit the file in Sublime, it will commit to corresponding branch.

any contribution of ideas of how to manage multiple sandboxes for one project in Github will be appreciated.

  • Or use IlluminatedCloud with intelliJ which has built in GIT integration.....Much better product IMHO but it does bring some technical debt as you would have to learn or get used to a new tool. Worth it IMHO. At least take a look at it and see if it fits your needs. I also see The Welkins Suite is now available for mac. – Eric Dec 12 '16 at 2:12
  • If I understand your question correctly, your assumption is not correct that mavensmate needs empty folder. You can create a project in mavensmate for an empty folder and then check out from your github branch into the same folder. It may overwrite the files mavensmate downloaded when creatung project but thats ok because you want files from your github branch. I am working with same setup from last one year and no issues. – javanoob Dec 12 '16 at 2:26
  • @javanoob will this solve the one branch per sandbox problem? how can I check a branch into a folder? – Lee Dec 12 '16 at 3:34
  • 1
    What is it you are trying to solve by creating one branch per sandbox? We create branch per each story or ticket we are working on and all the branches have same ancestor(master). These branches get merged into release or sprint branches. To checkout a branch into folder, First create a mavnesmate project in a folder and this will create some files specific to your sandbox and mavensmate. Once you created the project, go into the same folder and do the command "git checkout <branchname>". – javanoob Dec 12 '16 at 3:51
  • @javanoob I am using it for the same purpose, except different features sitting in different sandboxes. if you put all sandboxes' folders in one git repository aren't they going to be checked out all at the same time? are you able to check out one folder in the repo to a particular branch? – Lee Dec 12 '16 at 4:26
2

What you can do is using a separate folder for your git folder. And for each org(sandbox) you can have a separate Mavensmate folder. You can use a integration plugin to sync between those folders. Below are the plugins I have written:

Sublime: https://github.com/Lanceshi2/SyncFileYouWant

Atom: https://github.com/Lanceshi2/SyncFileYouWant-Atom

After pulling from test org/package org, (Reverse sync), you can refresh your own org(sandbox) using either CI system or changeset. Then you can refresh your mavensmate folder by refreshing folder functionality provided by Mavensmate.

  • Thank you Lance. I am trying this, will let you know how it goes. – Lee Dec 12 '16 at 3:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.