我想在我的本地virtualenv中安装带有pip的git pull请求进行测试.我想直接从github安装它,而不创建本地git存储库.
gue*_*tli 33
您可以通过附加哈希来向URL添加确切的提交:
pip install git+https://github.com/other-repository/project.git@remote_branch_name
Run Code Online (Sandbox Code Playgroud)
例:
pip install --user git+https://github.com/d1b/pip.git@fix_pip_build_directory
Run Code Online (Sandbox Code Playgroud)
或者一次提交.但是如果拉取请求(远程分支)得到更新,则不会更新:
pip install --user git+https://github.com/d1b/pip.git@d89b5803db2b520e754b9b26b771d22121738637
Run Code Online (Sandbox Code Playgroud)
小智 14
github为您提供的一个简洁功能是它可以预先合并拉取请求,并将它们作为隐藏参考提供,您可以特别提取.如果您正在构建CI系统来测试拉取请求,那么这非常有用.
直到最近,PIP不支持指定这些隐藏的裁判,但在上个月,支持已降落在PIP(10.0.1证实工作的)这一点.
以下命令将为以下内容安装拉取请求123的合并版本user/repo:
pip install git+https://github.com/user/repo.git@refs/pull/123/merge
Run Code Online (Sandbox Code Playgroud)
另外,要安装未合并版本的pull请求123(不要乱用github API来跟踪原始分支!):
pip install git+https://github.com/user/repo.git@refs/pull/123/head
Run Code Online (Sandbox Code Playgroud)