How to include git branch in installing from requirements in Python? [duplicate]
Asked Answered
P

1

9

Hi I need to install from a branch of a git repo. I want to include it on the requirements.txt so that it would install using the command pip install -r requirements.txt

What I know is how to install from master branch (See git ssh entry below):

This is my requirements.txt

networkx==2.4
numpy==1.18.1
opencv-python==4.2.0.32
scipy==1.4.1
git+ssh://[email protected]/project/project-utils.git

What if I want to install from a specific branch namely 1-fix-test on ssh://[email protected]/project/project-utils.git.

How do I include the branch name with the ssh address?

Plutonic answered 7/4, 2020 at 11:36 Comment(2)
No. The chosen answer does.Plutonic
stackoverflow.com/search?q=%5Bgit%5D+%5Bpip%5D+branchHalfslip
P
12

According to the document, you can add branch name or commit hash after @:

git+ssh://[email protected]/project/project-utils.git@1-fix-test
Profit answered 7/4, 2020 at 11:51 Comment(1)
@scrowler I’ve just updated the link, please check now.Avie

© 2022 - 2024 — McMap. All rights reserved.