Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit » [JGIT] How to get started(How to receive informationos from a remote Repository)
[JGIT] How to get started [message #692404] Mon, 04 July 2011 07:44
Lord_aratorn is currently offline Lord_aratorn
Messages: 2
Registered: May 2011
Junior Member
Hello,
id like to connect to a remote git-repository using the jGit-API.
But i have no clue how to do so.
Ive tryed to get started with the jGit userGuide.
But already the first line of code do not work at all.
After ive changed that code to a running one, it will look like this.

RepositoryBuilder builder = new RepositoryBuilder();
	try {
		Repository repository = builder.setGitDir(new File("git@myServer")).readEnvironment().findGitDir().build();
		Map<String, Ref> tags = repository.getTags();
		for (String key : tags.keySet()) {
			System.out.println(key+":"+tags.get(key).toString());
		}
	} catch (IOException e) {
		e.printStackTrace();
	}

But i got no result of those executions.

A second question which arises is, who can a connection to that remote repository be established using an ssh_privatekey and pagent as keyagent?

Thanks for the help.
Previous Topic:Old EGit versions
Next Topic:key bindings conflct with Java development
Goto Forum:
  


Current Time: Tue Jul 22 07:40:33 EDT 2014

Powered by FUDForum. Page generated in 0.01482 seconds