plain-js-git

Minimal git client for the web using isomorphic-git, with File System Access API functionality. Remote actions are not included (e.g. clone, push, pull).

Useful for quickly managing local git repository where git client is not installed or loading IDE with integrated git client takes time (e.g. VSCode on low-end laptops and Chromebooks).

Limitations

Troubleshooting

Line Break Issue

When working on Windows OS, cloned repository files will likely to have a different line break type (CLRF \r\n, LF \n) from the remote. This causing the files to be marked as modified.

I haven’t found any solid solution but you can try to configure git and setup a .gitattributes file. It’s required to have git installed on your system.

git config --global core.autocrlf input
git rm --cached -r .
git reset --hard

References:

How To

Get StatusMatrix

await compoGit.TaskGetStatusMatrix()

Development

Updating the Page

I use divless HTML format. If possible, edit the .divless/index.html file instead of editing index.html directly. You’ll need to install the Divless HTML VS Code extension to convert the format automatically upon saving.