I'm new on the job. I work as a junior java developer. We use Intellij IDEA java development editor, git(atlassian) and jira. I have a problem with git. This problem is when I try I get an error what is say "Couldn't save uncommitted changes. Tried to save uncommitted changes in stash before Update, but failed with an error.".
Here is the screen shots of my git configuration and errors.
Go to this repo from git bash.
Then run this command (to check your current unstage changes) :
git status
Then apply below command to stash them :
git stash save "give proper comment to identify it later"
Now to check your unstage changes are in stash or not run this command :
git stash list
Now, you can pull your latest changes from your remote branch. (git pull)
To reapply your stash after pull :
git stash apply stash_id
(here, stash_id is like stash@{n})
I had the same issue. My solution was to set the global git config!
$ git config --global user.name "John Doe"
$ git config --global user.email [email protected]
After that IntelliJ worked fine again.
Your IDE is trying to stash your changes before he does the merge (pull = fetch+merge) and fail to do it.
It is something like this:
Tried to save uncommitted changes in stash but failed with an error.
The easiest thing is to open git bash, check the status and then stash, add or discard your changes.
Few notes:
Intellij has something internal called shelf, its similar to git stash but the files are stored and handled by IntelliJ and not by git, so keet this in mind if you decide to stash
(shelf
) within the IDE.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With