MSL Wiki
MSL on GitHub

Git in MSL Files

See a folder's branch, changes and history without leaving the file browser.

Chapter 10 of 203 min read
On this page 6 sections

The dot#

A folder that is a git repository carries a dot in the listing:

A green ringNothing has changed
A filled red dotSomething has — hover it for the branch and a count
No dotNot a repository, or MSL could not read it

That last row matters. No dot never means "clean" — a repository MSL could not read in time produces no dot at all, rather than a green one on the strength of an answer nobody got.

The dots are read when you open a folder, when you come back to the MSL Files window, and when you close the Git panel. They are deliberately not on a timer: inside an instance every check is a command sent to Linux, and asking on a loop would stop an idle instance ever going to sleep. So if you change something in a terminal, click back into MSL Files and the dot catches up.

The panel#

Right-click a folder and choose Git…, or press ⌃⌘G. MSL Files shows what git knows about it: the branch, the origin with a button to copy it, how far ahead or behind the upstream, the working tree split into conflicted, staged, changed and untracked, and the last fifty commits.

It works on Mac folders and on folders inside an instance, and it looks the same either way.

Where git actually runs#

For a folder inside an instance, git runs inside that instance, not on your Mac. This matters more than it sounds:

Why
The share MSL mounts does not carry real Linux permissionsMac-side git would report every file as changed
A status check stats every fileDoing that over the share is slow enough to be unusable
The repository's own config, hooks and ignore rules live in LinuxThey are what should apply

So the instance has to be running. A stopped one says so rather than guessing, because MSL will not start an instance just to decorate a folder.

It reads, and does not write#

There is no commit, push, pull or fetch, and that is the design rather than a gap. Anything that talks to a remote may need a password, and MSL has nowhere to ask for one — so it would hang rather than prompt. Anything that rewrites history deserves a terminal, where you can see what happened and undo it.

The one thing it will create is a repository where there is none: a folder that is not one offers Initialise a repository here, which is git init and nothing else.

The remote#

The panel shows origin if there is one, with buttons to copy it and — for addresses that certainly have a web page — open it in your Mac browser. Change edits it; a repository with no remote offers Add one instead. Clearing the box removes the remote.

This only writes the address into the repository's own config. It does not contact anything, and there is still no push or pull here for the reason above.

If the panel says git is not installed#

That is the instance talking, not your Mac. Install it the way that distro does — apk add git, apt install git, dnf install git — and open the panel again.

On the Mac side, git comes with Xcode's Command Line Tools. MSL checks for them first rather than running /usr/bin/git, because without them that command does not fail: it opens a system dialog offering to install them, and a dialog appearing because you opened a folder is not what anyone wants from a file browser.