Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit » Resetting/Unstaging Files Does Not Seem To Work(Resetting/Unstaging Files Does Not Seem To Work)
Resetting/Unstaging Files Does Not Seem To Work [message #650963] Thu, 27 January 2011 05:28
No real name is currently offline No real name
Messages: 1
Registered: January 2011
Junior Member
I have been using JGit successfully to do many of the basic operations i need on a Git repository, but i have been struggling with doing this one for a while now and could use some help.

I have found the following way to unstage files that partly works (works for some files) but does not work at all for others. Ie. the index is left in an incorrect state.

State before staging:
modified: file1
missing: file2
untracked: file3

state after staging:
changed: file1
removed: file2
added: file3

all good so far, now after running the commands below to unstage all files i get the incorrect state below:

State after unstaging:
removed: file1
untracked: file1 --> this files shows up with two statuses which is wrong and it is marked incorrectly in both, ie. it should be modified
removed: file2 --> this should go back to missing
untracked: file3 --> this is correct



Commands i use to achive partial unstage:

repository.getIndex().remove(getWorkignDirectoryAsFile(), new File(getWorkignDirectoryAsFile(), fileName));

repository.getIndex().write();
Previous Topic:Change GIT repository location with SHARE?
Next Topic:How to write Git commands using EGit?
Goto Forum:
  


Current Time: Wed Apr 16 15:53:19 EDT 2014

Powered by FUDForum. Page generated in 0.01548 seconds