用pip安装特定的git commit [英] Install specific git commit with pip
问题描述
我正在开发一个django应用程序,我正在使用pip来管理我的需求。我怎么能安装一个特定的git的提交?
在我的情况下,我需要安装此提交:
https://github.com/aladagemre/django-notification/commit/2927346f4c513a217ac8ad076e494dd1adbf70e1
您可以指定提交哈希,分支名称,标记。
对于分支名称和标记,还可以安装压缩分配。这更快,更高效,因为它不需要克隆整个存储库。
哈希:
c $ c> $ pip install git + git://github.com/aladagemre/django-notification.git@2927346f4c513a217ac8ad076e494dd1adbf70e1分支名称
使用git
$ pip install git + git://github.com/aladagemre/django-notification.git@cool-feature-branch
或源码包
$ pip install https://github.com/ aladagemre / django-notification / archive / cool-feature-branch.tar.gz
标记
使用git
$ pip install git + git://github.com/aladagemre/django-notification.git@v2.1.0
或从源码包
$ pip安装https://github.com/aladagemre/django-notification/archive/v2.1.0.tar .gz
<这是一个没有很好记录的功能,但你可以在 https://pip.pypa.io/en/latest/reference/pip_install.html#git
I'm developing a django app and I'm using pip to manage my requirements. How can I do to install a specific git's commit?
In my case I need to install this commit: https://github.com/aladagemre/django-notification/commit/2927346f4c513a217ac8ad076e494dd1adbf70e1
You can specify commit hash, branch name, tag.
For the branch name and the tag, you can also install a compressed distribution. This is faster and more efficient, as it does not require cloning the entire repository. GitHub creates those bundles automatically.
hash:
$ pip install git+git://github.com/aladagemre/django-notification.git@2927346f4c513a217ac8ad076e494dd1adbf70e1
branch-name
With git
$ pip install git+git://github.com/aladagemre/django-notification.git@cool-feature-branch
or from source bundle
$ pip install https://github.com/aladagemre/django-notification/archive/cool-feature-branch.tar.gz
tag
with git
$ pip install git+git://github.com/aladagemre/django-notification.git@v2.1.0
or from source bundle
$ pip install https://github.com/aladagemre/django-notification/archive/v2.1.0.tar.gz
It is a not well-documented feature, but you can find more information at https://pip.pypa.io/en/latest/reference/pip_install.html#git
这篇关于用pip安装特定的git commit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!