Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Apply stashed changes during interactive rebase
Apply stashed changes during interactive rebase [message #1720745] Wed, 20 January 2016 15:53 Go to next message
Dmitry Katsubo is currently offline Dmitry KatsuboFriend
Messages: 14
Registered: November 2010
Junior Member

Dear community,

  • I have made changes in the local Git repository. Now I want to apply these changes to some my commit in the past.
  • In the "History" view I have selected the necessary commit and called "Rebase Interactive" from contact menu. The dialog appears saying that I have uncommitted changes, which suggests to Commit, Stash or Reset the changes. I choose "Stash" and confirm also the next dialog with a name for stashed commit.
  • The rebase completes and now I want to apply stashed changes. How can I do that? I cannot find anything in context menu of the project.

I have opened the "Git Repositories" perspective and I can see my commit in "Stashed commits". Again, I would assume that there is a context menu item "Apply" for it.

Additional info: JGit 3.4.2, Eclipse 4.4.

[Updated on: Wed, 20 January 2016 15:58]

Report message to a moderator

Re: Apply stashed changes during interactive rebase [message #1720782 is a reply to message #1720745] Wed, 20 January 2016 22:53 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
JGit/EGit version 3.4.2 is outdated so you should first update to the latest EGit release which is 4.1.1
Find that here http://download.eclipse.org/egit/updates

Find your repository in the Git repositories view, open it's node "Stashed commits",
select the one you want to apply and click "Apply stashed changes". If you first want
to see it's content simply double click the stashed commit.
Re: Apply stashed changes during interactive rebase [message #1721013 is a reply to message #1720782] Fri, 22 January 2016 15:11 Go to previous messageGo to next message
Dmitry Katsubo is currently offline Dmitry KatsuboFriend
Messages: 14
Registered: November 2010
Junior Member

Thanks for advise. I have updated to v4.2.0. When trying to apply stashed changes on the top of rebase I get this message:
Exception:org.eclipse.team.core.TeamException: Cannot apply stashed commit on a repository with state: REBASING_INTERACTIVE
	 at org.eclipse.egit.core.op.StashApplyOperation$1.run(StashApplyOperation.java:82)
	 at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2241)
	 at org.eclipse.egit.core.op.StashApplyOperation.execute(StashApplyOperation.java:87)
	 at org.eclipse.egit.ui.internal.commit.command.StashApplyHandler$1.runInWorkspace(StashApplyHandler.java:56)
	 at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:39)
	 at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

What I do wrong?
Re: Apply stashed changes during interactive rebase [message #1721961 is a reply to message #1721013] Mon, 01 February 2016 21:22 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
this stack trace should have another exception as its root cause, can you attach the complete stack trace
check the Eclipse error log view to find this.
Re: Apply stashed changes during interactive rebase [message #1723106 is a reply to message #1721961] Thu, 11 February 2016 16:31 Go to previous messageGo to next message
Dmitry Katsubo is currently offline Dmitry KatsuboFriend
Messages: 14
Registered: November 2010
Junior Member

There is not much more in the log file. What I did:

  • Emptied the log file (.metadata\.log).
  • Pressed "Apply Stashed Changes".

Complete log file is:
!ENTRY org.eclipse.egit.ui 4 0 2016-02-11 17:13:47.184
!MESSAGE Applying stashed commit '2e1fc89' failed due to 'Cannot apply stashed commit on a repository with state: REBASING_INTERACTIVE'
!STACK 1
org.eclipse.team.core.TeamException: Cannot apply stashed commit on a repository with state: REBASING_INTERACTIVE
	at org.eclipse.egit.core.op.StashApplyOperation$1.run(StashApplyOperation.java:82)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2241)
	at org.eclipse.egit.core.op.StashApplyOperation.execute(StashApplyOperation.java:87)
	at org.eclipse.egit.ui.internal.commit.command.StashApplyHandler$1.runInWorkspace(StashApplyHandler.java:56)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:39)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
!SUBENTRY 1 org.eclipse.team.core 4 0 2016-02-11 17:13:47.184
!MESSAGE Cannot apply stashed commit on a repository with state: REBASING_INTERACTIVE

The screenshot:
https://dl.dropbox.com/s/btpl9xjm783ew7y/eclipse-git-stash.png
Re: Apply stashed changes during interactive rebase [message #1723323 is a reply to message #1723106] Sun, 14 February 2016 09:59 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
Is the rebase operation really finished before you try to apply the stash ?

Does the staging view show a "Continue" button ?
If yes, click "Continue" in order to finish the rebase interactive and then try to apply the stash.
Re: Apply stashed changes during interactive rebase [message #1723330 is a reply to message #1723323] Sun, 14 February 2016 13:20 Go to previous messageGo to next message
Dmitry Katsubo is currently offline Dmitry KatsuboFriend
Messages: 14
Registered: November 2010
Junior Member

OK, I see the confusion that roots in my initial post. I want to apply stashed changes in the middle of rebase. I said "The rebase completes" but I meant "The rebase is initiated".
Re: Apply stashed changes during interactive rebase [message #1724939 is a reply to message #1723330] Sat, 27 February 2016 11:04 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
I think that's currently not supported in EGit, maybe you want to contribute that ?
Re: Apply stashed changes during interactive rebase [message #1724993 is a reply to message #1724939] Sun, 28 February 2016 19:27 Go to previous message
Dmitry Katsubo is currently offline Dmitry KatsuboFriend
Messages: 14
Registered: November 2010
Junior Member

OK, I see. Manu thanks for your support. I will use CLI as a workaround. Unfortunately I don't feel like I am able to contribute I have too many things to do.
Previous Topic:how do i update my workspace in eclipse after switching branches
Next Topic:Are the files physically stored on your local drive when you clone a repository?
Goto Forum:
  


Current Time: Fri Apr 26 05:11:52 GMT 2024

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

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

Back to the top