I am discussing a project where an interface will be provided for a team to enter data. We were hoping to store that data into a GIT repository so there's an easy overview of what changes were made to the data.

Would it be possible to make a commit with APEX code? Maybe a combination with Ant? Has anyone had to do anything similar in salesforce?


Apex cannot talk to Git directly. You'd need to make a callout to a server with the details and have that server perform a commit (and presumably push) against your Git repository.

Part of the Git architecture is that all clients/all repos are equal - the "master" repository is designated by convention, not by design. This means that Git implementations have to implement most or all of Git in order to be functional. Apex doesn't provide large swathes of what would be necessary to actually implement Git, such as a filesystem and sophisticated diffing algorithms.

An alternate design would have an external system call in to Salesforce to source data you've stored in a custom object and check that data into a repository, optionally after transforming it. This would likely be easier to implement; you could build it inside a continuous integration pipeline on any major Git hosting provider.

| improve this answer | |

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.