If you want opam to reflect your local changes then you can pin against your local copy with opam pin /path/to/local_lib
If the library you’re editing and project you’re using it from are both using jbuilder then you can also symlink the library from inside of your project and jbuilder will automatically use the locally copy. For a rough example, if you have local_lib cloned and edited here:
/path/to/local_lib
and your project using local_lib here:
/path/to/my_project
then you can create a symlink to /path/to/local_lib under my_project and jbuilder will use the linked version of local_lib:
my_project/local_lib is a symlink to /path/to/local_lib