How to install from a specific git branch with OPAM
Asked Answered
H

1

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?

Hilversum answered 13/8, 2014 at 3:33 Comment(0)
L
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
Linalool answered 13/8, 2014 at 8:56 Comment(1)
Make sure not to forgot the '.git' part of the url right before the '#' sign. Without that it doesn't, I made that mistake.Lorrianelorrie

© 2022 - 2024 — McMap. All rights reserved.