[JGIT] How to get started [message #692404] |
Mon, 04 July 2011 07:44 |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.27142 seconds