7

I have a project, which offers different features in different git branches. I believe, this is mostly done to simplify external dependencies (that is someone who wants to work with sqlite will not depend on modules for mysql and so on). Unfortunately, the functionality I need does not reside in master.

Is there a way to tell OPAM to fetch the project from a specific branch when installing? If not how might it be possible to add such project into OPAM?

Thomash
  • 6,339
  • 1
  • 30
  • 50
everiq
  • 149
  • 6

1 Answers1

14

Use opam pin. Put the branch name after a #, e.g. to use my "checksum" branch of the OCaml tcpip library instead of the upstream one:

$ opam pin tcpip https://github.com/talex5/mirage-tcpip.git#checksum
Thomas Leonard
  • 7,068
  • 2
  • 36
  • 40
  • Make sure not to forgot the '.git' part of the url right before the '#' sign. Without that it doesn't, I made that mistake. – Kris May 22 '22 at 14:09