Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit » Checkout private repositories(How to checkout private repositories with username and password)
Checkout private repositories [message #923110] Tue, 25 September 2012 11:56 Go to next message
kaleeswaran S is currently offline kaleeswaran S
Messages: 6
Registered: September 2012
Junior Member
I want to checkout a private git repository using JGIT with username and password. How to do this. I doubt whether JGIT is having anyway to do that ?
Re: Checkout private repositories [message #925279 is a reply to message #923110] Thu, 27 September 2012 11:08 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias Sohn
Messages: 556
Registered: July 2009
Senior Member
You need to register a CredentialsProvider, see
org.eclipse.jgit.transport.CredentialsProvider.setDefault(CredentialsProvider p)

Also have a look at how EGit is doing that with
org.eclipse.egit.ui.internal.credentials.EGitCredentialsProvider.
Re: Checkout private repositories [message #934093 is a reply to message #925279] Fri, 05 October 2012 12:44 Go to previous message
kaleeswaran S is currently offline kaleeswaran S
Messages: 6
Registered: September 2012
Junior Member
Thanks for your answer.

UsernamePasswordCredentialsProvider user = new UsernamePasswordCredentialsProvider(login, password);
Git repo1 = Git.cloneRepository().setURI(url).setDirectory(directory).setCloneAllBranches(true).call();
Previous Topic:Merge disabled
Next Topic:How to checkout previous revision?
Goto Forum:
  


Current Time: Thu Aug 28 23:42:18 EDT 2014

Powered by FUDForum. Page generated in 0.07642 seconds