How can I install a specific git branch with pipenv? I know this command will install the bitcoinlib master branch
pipenv install -e git+https://github.com/1200wd/bitcoinlib.git#egg=bitcoinlib But how can I install a branch that isn't master?
You need to simply use the @ symbol to specify branch and change the egg name to be a bit different if you're also using the master or some other branch. Follow this syntax
pipenv install -e git+<your/target/git/repository/url.git>@branch#egg=package_name So in my example I needed to use the segwit-support branch
pipenv install -e git+https://github.com/1200wd/bitcoinlib.git@segwit-support#egg=bitcoinlib_segwitsupport Which adds this line to my pipfile
bitcoinlib_segwit-support = {editable = true, ref = "segwit-support", git = "https://github.com/1200wd/bitcoinlib.git"} I think this Post discusses exactly your issue. For a specific version/branch you need to modify the https url.
There is another way you can do that:
packages_name = {git = "https://repository_url.git", ref = "branch_name", editable=True}
editable = True means that the package is installed in "editable mode." This allows changes made directly to the source code of the package to be immediately reflected in the environment where the package is installed, without needing to reinstall the package.
Example:
[packages]
nemoguardrails = {git = "https://github.com/NVIDIA/NeMo-Guardrails.git", ref = "develop", editable = true}
Once you have done this, run the following in your terminal:
pipenv install