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)
PushResult result = resultIterable.iterator().next();
TrackingRefUpdate trackingRefUpdate = result

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-]

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: 1111
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: Sat Jan 18 08:38:55 GMT 2020

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

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

Back to the top