Skip to main content



      Home
Home » Eclipse Projects » EGit / JGit » [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
Eclipse UserFriend
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: Sat Jul 05 01:39:21 EDT 2025

Powered by FUDForum. Page generated in 0.27142 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top