Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » How to checkout a file
How to checkout a file [message #1239912] Wed, 05 February 2014 10:10 Go to next message
David  Pérez is currently offline David PérezFriend
Messages: 228
Registered: July 2009
Senior Member
I'm quite new to git and jgit.

I wonder how I can revert a file not yet commited.

Whith git command line I can do:
git checkout -- file


but with org.eclipse.jgit.pgm-3.2.0.201312181205-r.sh, this syntax doesn't work, as it only expects a branch name as argument, and not a filename.

Thanks in advance for any tip.

[Updated on: Wed, 05 February 2014 11:34]

Report message to a moderator

Re: How to checkout a file [message #1240001 is a reply to message #1239912] Wed, 05 February 2014 13:50 Go to previous messageGo to next message
R Shapiro is currently offline R ShapiroFriend
Messages: 386
Registered: June 2011
Senior Member
My understanding is that JGit is primarily for programatic use: If you have a Java application that needs to checkout a different version of a given file in a Git repository, the JGit jar will provide what you need to do that. The EGit plugin uses JGit in this way.

The JGit command-line script is somewhat secondary. It covers only a subset of the supported operations, and only a few variants of each. For general command-line access to a Git repository, with all the options, you should be using standard Git.




Re: How to checkout a file [message #1240055 is a reply to message #1239912] Wed, 05 February 2014 15:58 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
This isn't yet implemented in the command line client, the underlying porcelain API command CheckoutCommand
already supports this. I'll come up with a patch to implement this.
Re: How to checkout a file [message #1240368 is a reply to message #1240055] Thu, 06 February 2014 09:55 Go to previous messageGo to next message
David  Pérez is currently offline David PérezFriend
Messages: 228
Registered: July 2009
Senior Member
Thanks!
Re: How to checkout a file [message #1267347 is a reply to message #1240368] Sat, 08 March 2014 22:19 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
proposed implementation
https://git.eclipse.org/r/#/c/23086/
Previous Topic:Unable to launch project
Next Topic:synchronize view shows wrong conflicts
Goto Forum:
  


Current Time: Fri Apr 19 01:35:30 GMT 2024

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

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

Back to the top