简体   繁体   中英

How to install a specific git branch with 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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM