Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
正如文档所暗示的,调用create_file一个github.Repository.Repository对象应该创建一个文件,但我得到github.GithubException.UnknownObjectException.
create_file
github.Repository.Repository
github.GithubException.UnknownObjectException
我的代码是这样的:
`repo.create_file('filename', 'commitmessage', 'content')`
我究竟做错了什么?
似乎您需要以斜杠开头的文件名/。我已经尝试了以下命令,并且它有效:
/
In [12]: repo.create_file('/filename', 'commitmessage', 'content') Out[12]: {'commit': Commit(sha="201e0e5b91f7ec431d5b06cc47affff202e3de04"), 'content': ContentFile(path="filename")}