Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install a specific git branch with pipenv

Tags:

git

python

pipenv

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?

like image 405
arshbot Avatar asked Oct 17 '18 20:10

arshbot


1 Answers

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"}
like image 115
arshbot Avatar answered Nov 02 '22 18:11

arshbot