Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/311.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用java和github api连接到github存储库_Java_Github Api_Git Remote - Fatal编程技术网

如何使用java和github api连接到github存储库

如何使用java和github api连接到github存储库,java,github-api,git-remote,Java,Github Api,Git Remote,我需要使用java(使用我的凭据)创建远程Github存储库,并且需要将.Json文件推送到该repo 我看到了一些使用JGit的示例和其他参考资料,如 我写了一些小代码 GitHubClient client = new GitHubClient(); client.setCredentials("username", "password"); RepositoryService service = new RepositoryService(client); Repository re

我需要使用java(使用我的凭据)创建远程Github存储库,并且需要将.Json文件推送到该repo

我看到了一些使用JGit的示例和其他参考资料,如

我写了一些小代码

GitHubClient client = new GitHubClient(); 
client.setCredentials("username", "password"); 
RepositoryService service = new RepositoryService(client); 
Repository repo=new Repository(); repo.setName("newRepo"); 
service.createRepository(repo); 
它不起作用了


请帮我举一个有效的例子。这将非常有用。

您将在中找到关于以下方面的工作示例:

  • (它可以推送您添加/提交的任何文件,JSON与否)

您可以在中找到关于以下方面的工作示例:

  • (它可以推送您添加/提交的任何文件,JSON与否)