gpt4 book ai didi

git - 使用 pip 安装特定的 git commit

转载 作者:IT王子 更新时间:2023-10-29 01:18:37 27 4
gpt4 key购买 nike

我正在开发一个 Django 应用程序,我正在使用 pip 来管理我的需求。我该怎么做才能安装特定的 git 提交?

在我的例子中,我需要安装这个提交: https://github.com/aladagemre/django-notification/commit/2927346f4c513a217ac8ad076e494dd1adbf70e1

最佳答案

您可以指定提交哈希、分支名称、标签。

对于分支名称和标签,您还可以安装压缩发行版。这更快、更高效,因为它不需要克隆整个存储库。 GitHub 自动创建这些包。

哈希:

$ pip install git+https://github.com/aladagemre/django-notification.git@2927346f4c513a217ac8ad076e494dd1adbf70e1

分支名称

用 git

$ pip install git+https://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+https://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/ 找到更多信息。

关于git - 使用 pip 安装特定的 git commit,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13685920/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com