GitForce is a byte-compatible implementation of Git written entirely in Apex — repositories live inside Salesforce custom objects, driven by a Lightning Web Component UI, with real clone / fetch / push against GitHub over the Git smart-HTTP protocol.
// Create a repo, stage a file, commit — entirely in Apex Id repo = GitRepo.init('hello'); GitAdd.stage(repo, 'README.md', Blob.valueOf('# hi\n')); String sha = GitCommit.create(repo, me, me, 'first commit'); System.debug(sha); // => 8d3c1f... the exact SHA-1 real `git` would compute // ...then push it to a real GitHub remote GitRemote.push(repo, 'refs/heads/main'); ✔ pushed to github.com — objects match byte-for-byte
Salesforce has a database, an HTTP stack, native SHA-1, and Apex — which turns out to be just enough to host Git's content-addressable object model end to end.
Blobs, trees, commits and tags hash to the exact SHA-1
object IDs real Git produces — verified against the git CLI.
A hand-rolled DEFLATE decoder (fixed + dynamic Huffman, LZ77) and a stored-block encoder — so it reads and writes real zlib streams.
Parses delta-compressed packfiles (OFS_DELTA / REF_DELTA) and encodes packs to send — the payloads real clone/fetch/push use.
A pkt-line codec and smart-HTTP client talk to real Git servers. Clone a public repo into the org; push a commit back to GitHub.
add · status · commit · log · branch · checkout · diff (Myers) · merge (fast-forward & 3-way with a real merge base).
A Lightning app renders the repo home, file browser, commit diffs, issues, pull requests, and projects — all backed by Apex.
GitForce computes the same object hash you'd get from running
git on your laptop. That property is what lets it
interoperate with real remotes instead of being a Git-flavored
imitation — and it's checked by a harness that diffs GitForce output
against fixtures generated by the real Git CLI.
"hello\n" — canonical form
"blob 6\0hello\n" through SHA-1:
Verified end-to-end: a live network clone of GitHub's
octocat/Hello-World reproduces commit
7fd1a60b… exactly — proving the transport stack and
byte-compatibility against a real remote.
Git's content-addressable store maps cleanly onto Salesforce custom objects; the plumbing reproduces Git's canonical encoding; the transport layer speaks the wire protocol; and the surface exposes it to LWC, REST, and Flow.
Governor limits are respected honestly — SHA-1 is native and cheap; CPU-heavy inflate runs in async jobs; the callout response cap bounds clone size. The trade-offs are documented, not hidden.
GitForce ships as a namespaced (gitforce) Unlocked 2GP
package. Install it into any Salesforce org:
# Salesforce CLI
sf package install --package 04tDo00000012EYIAY \
--target-org <your-org> --wait 20 --publish-wait 20
Or open the install URL in a browser (log in to the target org first):
login.salesforce.com/packaging/installPackage.apexp?p0=04tDo00000012EYIAY
After install, open the GitForce app. To use remotes,
add your own GitHub token to the packaged
GitForce_GitHub Named Credential — no secret ships in the
package.