kel*_*nfc 153 git install pip commit
我正在开发一个django应用程序,我正在使用pip来管理我的需求.如何安装特定的git提交?
在我的情况下,我需要安装此提交:https: //github.com/aladagemre/django-notification/commit/2927346f4c513a217ac8ad076e494dd1adbf70e1
Hug*_*res 246
您可以指定提交哈希,分支名称,标记.
对于分支名称和标记,您还可以安装压缩分发.这样更快,更高效,因为它不需要克隆整个存储库.GitHub自动创建这些包.
哈希:
$ pip install git+git://github.com/aladagemre/django-notification.git@2927346f4c513a217ac8ad076e494dd1adbf70e1
Run Code Online (Sandbox Code Playgroud)
分店名称
用git
$ pip install git+git://github.com/aladagemre/django-notification.git@cool-feature-branch
Run Code Online (Sandbox Code Playgroud)
或来自源包
$ pip install https://github.com/aladagemre/django-notification/archive/cool-feature-branch.tar.gz
Run Code Online (Sandbox Code Playgroud)
标签
用git
$ pip install git+git://github.com/aladagemre/django-notification.git@v2.1.0
Run Code Online (Sandbox Code Playgroud)
或来自源包
$ pip install https://github.com/aladagemre/django-notification/archive/v2.1.0.tar.gz
Run Code Online (Sandbox Code Playgroud)
这是一个没有详细记录的功能,但您可以在https://pip.pypa.io/en/latest/reference/pip_install.html#git上找到更多信息.
PGu*_*uiv 16
对@ hugo-tavares答案的额外评论:
如果它是私有GitHub存储库,您将需要使用:
pip install git+ssh://git@github.com/....
Run Code Online (Sandbox Code Playgroud)
在你的情况下:
pip install git+ssh://git@github.com/aladagemre/django-notification.git@2927346f4c513a217ac8ad076e494dd1adbf70e1
Run Code Online (Sandbox Code Playgroud)
man*_*ysz 12
只需添加以下行,就可以使用项目中的requirements.txt文件自动安装python包:
-e git+https://github.com/owner/repository.git@branch_or_commit
并运行命令行:
$ pip install -r requirements.txt