如何克隆我的GitHub存储库的wiki?我知道它被保存为一个单独的Git存储库,但我不记得这条路径.
我试过...reponame/wiki.git和...reponame.git/wiki,但既不是正确的.
是否有任何方式以编程方式(使用库PyGithub,GitPython或dulwich)将任何文件加载到MyRepo.wiki.git存储库?当然,使用Python.
我可以MyRepo.git通过帮助轻松地将文件上传到存储库中PyGithub,但不幸的是,这个库没有API或使用MyRepo.wiki.git存储库的方法.
以下是我如何将文件上传到MyRepo.git存储库:
github_repo = github_account.get_user().get_repo('MyRepo')
head_ref = gh_repo.get_git_ref("heads/%s" % github_branch)
latest_commit = gh_repo.get_git_commit(head_ref.object.sha)
base_tree = latest_commit.tree
new_tree = gh_repo.create_git_tree(
[github.InputGitTreeElement(
path="test.txt",
mode='100755' if github_executable else '100644',
type='blob',
content="test"
)],
base_tree)
new_commit = gh_repo.create_git_commit(
message="test commit message",
parents=[latest_commit],
tree=new_tree)
head_ref.edit(sha=new_commit.sha, force=False)
Run Code Online (Sandbox Code Playgroud)
那么,怎么我可以做同样的,但与MyRepo.wiki.git资源库?如果你能提供一个使用PyGithub库的例子 - 那真的很棒.
PS我可以使用Gollum API吗?
PPS没有人*.wiki.git使用过任何类型的python库吗?我不相信 :(
PPPS如果我不够清楚:我不想以任何方式创建本地存储库.我只想动态修改repo结构 - 就像我的例子那样.但是使用*.wiki.git存储库.
谢谢!
Github的Wiki页面显示带有markdown-emulated页面的内容(例如https://github.com/github/gollum/wiki),而不是.md文件的纯文本.
Github在哪里向我们提供.mdWiki页面上的文件来源?