问题标签 [gitpython]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
3064 浏览

python - 在 Windows 7 上安装 GitPython

我似乎无法在我的 Windows 7 环境中安装 GitPython。我在 python-2.7.8 和 python-3.4.1 上都尝试了 GitPython-0.1.7 和 GitPython-0.3.2.RC1,所有组合都会导致失败。

我使用“python setup.py install”来安装这些包。

GitPython-0.1.7 似乎需要 ez_setup 反过来又失败了,因为它需要 setuptools。

GitPython-0.3.2.RC1 似乎需要 gitdb-0.5.4 引发许多警告

我知道python-3.x 不支持GitPython,这仍然是真的吗?

正如你可以从我的漫谈中看出的那样,我有点沮丧,希望得到一些指导。

0 投票
1 回答
188 浏览

python - 混帐日志——在终端上工作正常,但在 git python 中执行 g.log(file_name) 显示错误

对于某些文件,碰巧在 Git Python 中 g.log() 指令会出错,但是对于同一个文件,如果我在终端上执行 [$git log -- ] ,则可以正常工作。终端上的以下命令效果很好:

这是我的python代码:

core/model/org/eclipse/jdt/internal/core/CompilationUnitVisitor.java':未知修订版或路径不在工作树中。使用 '--' 将路径与修订分开,如下所示:'git [...] -- [...]'

有人可以建议如何纠正它吗?

0 投票
3 回答
1262 浏览

clone - 使用 GitPython 克隆 Git 存储库 - 找不到存储库 身份验证失败

我正在尝试使用 Python 克隆私有存储库。我正在使用 Git Python 包克隆存储库,但出现错误:

错误:GitCommandError:'git clone -v https://github.mit.edu/mitx/content-mit-1690rgit edxcourse'返回退出状态128:克隆到'edxcourse'...找不到远程存储库。致命:“ https://github.mit.edu/mitx/content-mit-1690.r.git/ ”的身份验证失败

但是,我是该存储库的成员,并且可以访问该存储库。

0 投票
1 回答
1786 浏览

python - 为什么 Windows 上的 gitpython 总是出现找不到文件的错误?

在查看位于此处的 gitpython 教程时,我的机器上存在一些问题。环境是 Windows 7,git 版本 1.7.11.msysgit.1 以及 Python 2.7。使用 easy_install 安装一切正常。Repo 对象成功创建,命令repo.tree()repo.branches工作一样。如果我这样做repo.is_dirty(),则会出现未找到非特定文件的错误。 WindowsError: [Error 2] The system cannot find the file specified.有任何想法吗?

TIA 寻求帮助。

0 投票
1 回答
630 浏览

python - Python - A Git module which doesn't depend on the git binary file

I need a Python module which does not depend on the Git binary file. It should manipulate the index on its own, without making use of the git commands. Following are the basic requirements.

  1. Clone
  2. Commit
  3. Push to remote
  4. Handle authentication with username and password, and keys
  5. Pull and checkout files

As far as I know, GitPython and Gittle needs the git binary file. I'm looking for a python alternative for JGit which doesn't make use of the git binary.

0 投票
1 回答
278 浏览

python - GitPython 导致 concurrent.futures.ThreadPoolExecutor 忽略 max_workers

我正在编写一些 Python 代码来并行对大量 git 存储库执行操作。为此,我尝试结合concurrent.futuresGitPython,在单独的未来任务中克隆每个存储库。这是使用 OS X 10.10 上的内置 Python 2.7.6 以及通过 pip 安装的 GitPython 0.3.5 和 futures 2.2.0(向后移植到 2.7 的版本)。

我正在使用的代码的一个简单示例如下:

当我将wait_then_return函数提交给 executor 时,我得到了预期的行为:首先以四个为一组进行打印,然后大致沿着这些线完成,直到所有期货都完成。如果我切换它,clone_then_return那么执行程序似乎忽略了 max_workers参数并并行运行所有 20 个期货。

这可能是什么原因?

0 投票
1 回答
977 浏览

python - GitPython - clone_from 不工作

克隆 git repo 时遇到问题。

我正在使用来自 GitPython 库的函数clone_from

从 git 导入回购

repo.clone_from("git://github.com/facebook/buck.git", "D:\sample")

我收到错误

WindowsError:系统找不到指定的文件

有人可以告诉我这是否是如何使用库克隆回购吗?

0 投票
2 回答
798 浏览

python - 拉后GitPython在工作副本中没有任何内容

我是 PythonGit 的新手,拉和推有问题。我在本地创建了裸仓库并将初始提交推送给它。之后,我尝试使用 PythonGit 初始化新用户 repo,获取并从中提取。我对初始化存储库没有任何问题,但是我无法从远程/裸存储库中获得任何东西。我的代码:

在用于获取和拉取的 ipython 控制台中,我得到:

用于获取和

拉。拉动操作后,根本没有拉动任何东西,回购仍然是空的,但存在。我做错了什么?

0 投票
1 回答
3724 浏览

python - GitPython——如何“git stash”对 GitPython 存储库的更改?

我有一个通过 GitPython 库创建的存储库,其中包含一些未提交的更改。我想隐藏这些更改。我该怎么做?

在 GitPython文档中搜索“stash”没有返回任何结果。

0 投票
6 回答
24112 浏览

python - GitPython 和 SSH 密钥?

如何将 GitPython 与特定的 SSH 密钥一起使用?

该文档在该主题上不是很详尽。到目前为止,我唯一尝试过的是Repo(path).