Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Error pushing to remote
Error pushing to remote [message #1203310] Fri, 22 November 2013 15:43 Go to next message
Gaurav Sharma is currently offline Gaurav SharmaFriend
Messages: 2
Registered: October 2012
Junior Member
I'm using the jgit.jar in a custom web application. I'm using the following code to push local repo changes to master:

String remote = "origin";
String branch = "refs/heads/master";
String trackingBranch = "refs/remotes/" + remote + "/master";
RefSpec spec = new RefSpec(branch + ":" + branch);
Iterable<PushResult> resultIterable = git.push().setRemote(remote)
		.setRefSpecs(spec).call();
PushResult result = resultIterable.iterator().next();
TrackingRefUpdate trackingRefUpdate = result
		.getTrackingRefUpdate(trackingBranch);


When I use this code in a standalone java class (i.e. with public static void main method), it works just fine. But when I incorporate this into my project, it fails with the following error:

Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.jgit.transport.Transport
	at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:144) [org.eclipse.jgit-3.1.0.201310021548-r.jar:3.1.0.201310021548-r]


I have jsch.jar in the class path as well. Not sure why this is failing.
Re: Error pushing to remote [message #1216674 is a reply to message #1203310] Thu, 28 November 2013 15:32 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
which version are you using ? You may need to add javaewah and apache.commons.compress
Previous Topic:Way to use local masterBranch
Next Topic:JGit iterate all files of a commit
Goto Forum:
  


Current Time: Thu Apr 25 14:58:01 GMT 2024

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

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

Back to the top