Sublime Forum

Sublime Merge usage with devcontainers


I am trying to use dev containers in my development process, but I’m running into trouble with pre-commit hooks. A dev container is essentially a docker image for your dev environment. It allows your entire team to develop using a consistent system.

The problem is that npm (and other package managers) will install files using the os and architecture of the dev container, rather than the architecture of your machine. When Sublime Merge tries to run the pre-commit hooks, it runs them in the context of the host machine rather than the dev container.

There is a CLI tool for running commands in dev containers.

Adding this manually may work for me, but it would break for people that use VSCode for git, since that’s already running in the context of the docker image, and it would break things like GitHub Codespaces.



You’d need to create a wrapper shell script around git that runs devcontainer exec git and set that shell script as the “Git Binary” in Sublime Merge’s preferences.



Is there a way to set that per repository?



There is not