Applying stashed commit '...' failed due to 'Applying... egit error in eclipse
Asked Answered
P

8

12

i am trying to apply a stash that I did through eclipse but I am getting the next error message : Applying stashed commit '...' failed due to 'Applying stashed changes resulted in a conflict'. how can I resolve the conflicts in eclipse ? tried to open sync view but I didn't see anything that need to be resolved... using eclipse kepler.

Pasteur answered 24/7, 2014 at 11:13 Comment(0)
E
9

I had this happen when I included untracked files in my stash. I did a reset HARD to clear my working copy, then ran this from the command-line (the stash I wanted was on top of the stack):

git stash apply --index

Now I see my modified files, and my "untracked" files reappear. Not sure why the GUI doesn't work.

Using Eclipse Luna.

Exclusion answered 2/11, 2015 at 22:34 Comment(3)
Using Neon.2, also failed from EGit and worked for command-line (I didn't do any reset)Stepchild
In my case this worked however if the stash was not the latest stash then you would specify which stash git stash apply stash@{2}Labyrinthine
For me, the trick was doing the HARD reset. After that, applying the stash directly from the GUI worked for me (using Scala IDE, a derivative of Eclipse). Didn't need to apply the stash from the terminal.Dermis
P
8

I had the same problem when I stashed some work I was doing in order to do some last minute, urgent bug fixing.

In order to overcome this situation, I did the following in Eclipse (note that I used Luna version):

  • Right click on the Eclipse project -> Team -> Show in Repositories View
  • Find the "References" folder in the Repositories View, right click it, then select the "New Branch..." option.
  • Create a new branch with the stashed changes.
  • Checkout the original branch on which you want to apply the stash
  • Merge both branches and resolve conflicts the usual way.
Palmetto answered 8/10, 2015 at 14:28 Comment(1)
Easy and fast. Thank you!Leandro
P
4

I get this error every time I apply changes from stashed commit in neon.1 Looks like a bug. One of many bugs in egit

Purvey answered 15/12, 2016 at 13:44 Comment(0)
R
1

This commonly happens when you stash your changes in one branch and apply them on another.

To resolve these conflicts, you need to search for <<<<< which are git markers that git uses to tell you where and which branches have the conflicts.

Here's an exhaustive link that explains how to resolve the conflicts.

Roundsman answered 24/7, 2014 at 11:24 Comment(0)
H
0

Maybe you have change something and you need to stash this changes then you could apply the other stash.

I have used TortoiseGit and it said me more info about this problem.

Hope it's helps to resolve your problem :)

Herbivorous answered 12/3, 2015 at 13:10 Comment(0)
D
0

If ==>

  1. You have misteakenly applied stash changes to other branch
  2. Still You can not see the conflicts in file/s
  3. Replace with Index/Head doesn't work

Then ==>

Open "Git Staging" view, right click on file => replace with => Our version <....>.

This works for me. I hope it will work for you.

Deerskin answered 18/9, 2019 at 13:14 Comment(1)
This seems to be bug in eclipse. The second time I faced the issue, the solution above didnt worked. But I went to git staging --> right click on conflicted file -->add to index and magic, conflicted filed fixed itselfs.Deerskin
P
0

This could also happen if you have a "dirty" working directory. E.g. modified files you won't intend to commit anyway. If you don't need these changes and want to apply your stash on the last "clean" commit, run git restore . After that, you should be able to apply your stash.

Plantar answered 31/1 at 13:8 Comment(0)
C
-1

in my case in eclipse Oxygen it works if I go to Team>Stashes, click on the stash I want to resume and then in the "Stashed Commit" view click on the small brown and green Icon on the top on the right ("Apply stashed changes"). Very comfortable if you want to switch branches.

Coastwise answered 15/9, 2017 at 15:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.