Skip to content

NameError: name 'git' is not defined #811

@hick

Description

@hick

how can I debug something?

it's sth like this issue, while I think maybe different: #107

image

text version:

D:\hick\python>python git-.py
Traceback (most recent call last):
File "git-.py", line 6, in
repo = git.Repo(r'D:\hick')
NameError: name 'git' is not defined

D:\hick\python>pip show GitPython
Name: GitPython
Version: 2.1.11
Summary: Python Git Library
Home-page: https://github.com/gitpython-developers/GitPython
Author: Sebastian Thiel, Michael Trier
Author-email: byronimo@gmail.com, mtrier@gmail.com
License: BSD License
Location: d:\program\python35\lib\site-packages
Requires: gitdb2

D:\hick\python>cat git-.py
'''
操作 git 的演练
'''
from git import Repo

repo = git.Repo(r'D:\hick')

print(repo.bare)

D:\hick\python>python -V
Python 3.5.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions