我正在使用GitPython将远程存储库获取到我的机器上。下面的代码在我的Ubuntu12.04上运行得很好,但是在我的亚马逊ec2上,在Ubuntu11.10服务器上,我得到了OSError: Errno2No The file or directory errororigin.pull(origin.refs[0].remote_head)
当我在脚本中运行代码块时,我没有得到任何错误消息。/local/lib/python2.7/dist-p
到目前为止,我的代码正在执行以下操作。我想把subprocess.call()处理掉from subprocess import call
repo.remotes.origin.fetchrepo.head.reset(commit='origin/master', index=True, working_tree=True)
# I don't know how to do this using GitPyt
我正在尝试更新一个Python脚本,该脚本将检查从使用子进程到使用GitPython的几个本地存储库的状态。GitPython for git remote show origin中的等效命令是什么,或者检查本地回购是否可快速转发或过时(等等)的更好方法是什么?看起来,通过在GitPython上迭代git.Repo.heads和git.Repo.
在试图克隆repos时获得低于异常的 File "C:\Users\Selvakumar\AppData\Local\Programs\Python\Python36-32\lib\site-packages\git\cmd.py", line 622, in execute
**subprocess_kwargs-32\lib\site-packages\git\cmd.py", line 463, in