Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not find the .github file #223

Closed
to2raja opened this issue Sep 30, 2015 · 3 comments
Closed

Can not find the .github file #223

to2raja opened this issue Sep 30, 2015 · 3 comments

Comments

@to2raja
Copy link

to2raja commented Sep 30, 2015

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,

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

@to2raja
Copy link
Author

to2raja commented Oct 3, 2015

Any update in this?

@gansai
Copy link

gansai commented Oct 3, 2015

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.

Hope it helps. Let us know if it works.

@oleg-nenashev
Copy link
Collaborator

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.

@to2raja to2raja closed this as completed Oct 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants