【发布时间】:2017-12-08 05:01:44
【问题描述】:
我需要使用 java(使用我的凭据)创建远程 Github 存储库,并且我需要将 .Json 文件推送到该存储库。
我看到了一些使用 JGit 的示例和一些其他参考,例如 http://www.codeaffine.com/2015/11/30/jgit-clone-repository/
我写过小代码
GitHubClient client = new GitHubClient();
client.setCredentials("username", "password");
RepositoryService service = new RepositoryService(client);
Repository repo=new Repository(); repo.setName("newRepo");
service.createRepository(repo);
它不工作
请帮助我提供一个工作示例。那真的很有帮助。
【问题讨论】:
标签: java github-api git-remote