Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Possible to unstage/reset a single file?
Possible to unstage/reset a single file? [message #652757] Sun, 06 February 2011 12:10 Go to next message
h1055071 is currently offline h1055071Friend
Messages: 335
Registered: July 2009
Senior Member
Hi,

I'm getting to know eGit and git a whole lot better. It's looking good.

Is it possible to unstage/reset a single file? I know I can do a reset
for all staged files, but I'd like to do a single file, the equivalent of:

git reset HEAD newfile.java

Thanks
Re: Possible to unstage/reset a single file? [message #652941 is a reply to message #652757] Mon, 07 February 2011 17:12 Go to previous messageGo to next message
Chris Aniszczyk is currently offline Chris AniszczykFriend
Messages: 674
Registered: July 2009
Senior Member
File->Replace With->...

For resetting a current file... you'll have to wait until 0.12... it's going through the review process now...

http://egit.eclipse.org/r/#change,2415
Re: Possible to unstage/reset a single file? [message #653168 is a reply to message #652941] Tue, 08 February 2011 17:41 Go to previous messageGo to next message
h1055071 is currently offline h1055071Friend
Messages: 335
Registered: July 2009
Senior Member
On 07/02/2011 17:12, Chris Aniszczyk wrote:
> File->Replace With->...
>
> For resetting a current file... you'll have to wait until 0.12... it's
> going through the review process now...
>
> http://egit.eclipse.org/r/#change,2415

Thanks, Chris.
Re: Possible to unstage/reset a single file? [message #653324 is a reply to message #652757] Wed, 09 February 2011 11:42 Go to previous messageGo to next message
Robin Rosenberg is currently offline Robin RosenbergFriend
Messages: 332
Registered: July 2009
Senior Member
On 2011-02-06 13.10, Phillipus wrote:
> Hi,
>
> I'm getting to know eGit and git a whole lot better. It's looking good.
>
> Is it possible to unstage/reset a single file? I know I can do a reset
> for all staged files, but I'd like to do a single file, the equivalent of:
>
> git reset HEAD newfile.java
>
> Thanks

If you Enable quick diff you can select all text, right click in the
quickdiff bar to the left of the source code and select Revert
Selection. It reverts to the quickdiff baseline, which is by default HEAD.

-- robin
Re: Possible to unstage/reset a single file? [message #653370 is a reply to message #653324] Wed, 09 February 2011 14:45 Go to previous messageGo to next message
h1055071 is currently offline h1055071Friend
Messages: 335
Registered: July 2009
Senior Member
On 09/02/2011 11:42, Robin Rosenberg wrote:
> On 2011-02-06 13.10, Phillipus wrote:
>> Hi,
>>
>> I'm getting to know eGit and git a whole lot better. It's looking good.
>>
>> Is it possible to unstage/reset a single file? I know I can do a reset
>> for all staged files, but I'd like to do a single file, the equivalent of:
>>
>> git reset HEAD newfile.java
>>
>> Thanks
>
> If you Enable quick diff you can select all text, right click in the
> quickdiff bar to the left of the source code and select Revert
> Selection. It reverts to the quickdiff baseline, which is by default HEAD.
>
> -- robin
>

What I'm trying to do is not roll back the local changes to the file but
to "unstage" ("un-Add") it from the index. I can do this in smartgit,
just wondering if it's something planned for eGit.

Phil
Re: Possible to unstage/reset a single file? [message #725182 is a reply to message #653370] Wed, 14 September 2011 07:23 Go to previous messageGo to next message
troys2005 is currently offline troys2005Friend
Messages: 1
Registered: September 2011
Junior Member
Try using the mouse and dragging the file from the Staged Changes to Unstaged Changes. It seems to work. Let me know if this is what you were trying to do.

It would good to have a Stage/Unstage button in the Git Staging view. At least an Unstage since you can use Add for the initial Stage. Smile
Re: Possible to unstage/reset a single file? [message #725456 is a reply to message #725182] Wed, 14 September 2011 20:41 Go to previous message
R Shapiro is currently offline R ShapiroFriend
Messages: 386
Registered: June 2011
Senior Member
In addition to drag-and-drop in the Git Staging view, you can also unstage changes with drag-and-drop in the Synchronization view. But I always use the Git Staging view, since Synchronization is too slow for my projects.

Previous Topic:Symbolic links in Linux
Next Topic:EGit wont push - Hook Declined
Goto Forum:
  


Current Time: Thu Mar 28 19:12:36 GMT 2024

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

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

Back to the top