When I try to update a project from git, I get this error: Failed to save uncommitted changes

I am new to this job. I work as a junior Java developer. We use the Intellij IDEA development editor java, git (atlassian) and jira. I have a problem with git. This problem occurs when I try to get the error message "Failed to save uncommitted changes. I tried to save uncommitted changes to stash before Update, but not with an error.".

Here are screenshots of my configuration and git errors. Here is my git Intellij config Here is the error that I have

+5
source share
2 answers

Go to this repo from git bash.

Then run this command (to check for current inactivity changes):

git status 

Then apply the command below:

 git stash save "give proper comment to identify it later" 

Now, to verify that your unspecified changes are in the dash or not to run this command:

 git stash list 

Now you can transfer your latest changes from your remote branch. (git pull)

Reapply your cache after clicking:

 git stash apply stash_id 

(here stash_id is like stash @ {n})

+5
source

Your IDE is trying to hide your changes before it merges (pull = fetch + merge) and cannot do this.

This is something like this:

 Tried to save uncommitted changes in stash but failed with an error. 

The easiest way is to open git bash, check the status, and then save, add, or discard the changes.


A few notes:

Intellij has something internal called a shelf, similar to git stash, but the files are stored and processed by IntelliJ, not git, so pay attention to this if you decide to stash ( shelf ) in the IDE.

+1
source

Source: https://habr.com/ru/post/1239761/


All Articles