You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using this jar in my project. Happy to know that possible to create repo from java in GitHub. Thanks for your efforts..
I just added jars and tried to test as a java application, but I got an error, which says .github folder is not available.
Here is my code,
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
String name = "name - new-repo";
String description = "description - this is my new repository";
String homepage = "homepage - http://www.kohsuke.org/";
boolean isPublic = true;
GitHub github = GitHub.connectUsingPassword("myUserName", "password");
GHRepository repo = github.createRepository(name, description, homepage, isPublic);
System.out.println(repo.getOwner());
System.out.println(repo.getLanguage());
}
And the exception is as follows,
Exception in thread "main" java.io.FileNotFoundException: C:\Users\user\ .github (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(Unknown Source)
at org.kohsuke.github.GitHub.connect(GitHub.java:144)
at com.votsh.repository.GitRepo.main(GitRepo.java:28)
Thanks in advance
The text was updated successfully, but these errors were encountered:
Hi @to2raja,
You need to create a file named = '.github' in "C:\Users\user" folder. That .github file will contain two lines:
login=loginName
password=loginPassword.
BTW, the provided stacktrace does not fit the code you've provided. You don't call GitHub.connect() in it. IIRC GitHub.connectUsingPassword() should not require the .github as I see from the code.
Hi,
I am using this jar in my project. Happy to know that possible to create repo from java in GitHub. Thanks for your efforts..
I just added jars and tried to test as a java application, but I got an error, which says .github folder is not available.
Here is my code,
And the exception is as follows,
Exception in thread "main" java.io.FileNotFoundException: C:\Users\user\ .github (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(Unknown Source)
at org.kohsuke.github.GitHub.connect(GitHub.java:144)
at com.votsh.repository.GitRepo.main(GitRepo.java:28)
Thanks in advance
The text was updated successfully, but these errors were encountered: