2

I want to create a Java program which will login to a github account using username and password. I am using JGit library. I can see example snippets for git commands(commit,pull, etc) but not for login.

I know that JGit provides CredentialsProvider and UsernamePasswordCredentialsProvider for username and password, but I do not know how to use it to login to an account.

abhijeet
  • 849
  • 2
  • 19
  • 54

1 Answers1

0

This blog will help to get an understanding on the use of UsernamePasswordCredentialsProvider, http://gautirao.wordpress.com/2013/06/05/toying-around-with-jgit/

Ragavan
  • 997
  • 7
  • 11
  • 2
    Linking a blog is hardly a good answer, imo. Please, at least include some code and/or write a short explanation. – UIlrvnd Sep 10 '13 at 07:06
  • 2
    Posting some code is necessary as blog posts and even whole sites can vanish in time but SO is about keeping the valuable answer for future use/search. – Lenymm Sep 10 '13 at 07:37
  • I am looking for code which can authenticate username and password. – abhijeet Sep 10 '13 at 07:44