使用 pip 安装特定的 git commit [英] Install specific git commit with pip
问题描述
我正在开发一个 django 应用程序,我正在使用 pip 来管理我的需求.如何安装特定的 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.
对于分支名称和标签,您还可以安装压缩分发版.这更快、更有效,因为它不需要克隆整个存储库.GitHub 会自动创建这些包.
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.
哈希:
$ 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 install https://github.com/aladagemre/django-notification/archive/v2.1.0.tar.gz
这是一个没有详细记录的功能,但您可以在 https://pip.pypa.io/en/latest/topics/vcs-support/
It is a not well-documented feature, but you can find more information at https://pip.pypa.io/en/latest/topics/vcs-support/
这篇关于使用 pip 安装特定的 git commit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!