Atom Packages, Electron & Git usage

#1

I’m trying to decipher how Atom/APM handles pulling/updating of Packages within Electron.

From what I can tell, Atom bundles APM and uses its CLI interface to install Packages. APM installs packages by cloning the repos to the local filesystem.

The most glaring thing I don’t understand is hot APM can do this via Git, as it executes the clone command via the CMD - does this mean installing Git is a requirement to using Atom/APM? Or is it bundled in some way?

#2

Atom uses the git-utils package, which brings in its own version of git and doesn’t require an external one.

#3

For working with repos that already exist on the filesystem, yes - but not for cloning repos (Installing packages).

It seems to come down to this:

So at some point whilst APM is being built, it adds a folder prefixed with PortableGit_ to AppData, which it dynamically adds to the PATH so it can run git commands. See:

1 Like
#4

I guess my question is just how/when/what is this Portable Git binary that gets added to the PATH

#5

I’m not sure. I’ve been under the impression for a while that the executable used was the file shown in this screenshot, but I can’t find any basis for that in the code files.

#6

Sorry for the delayed response - ended up finding nodegit, which is git bindings for node. Works perfectly well :slight_smile: Thanks for the response!

1 Like