How to fix No local changes to save in Git

GitBEGINNERLOWUpdated Dec 6, 2025· 206 views

This message appears when running git stash but Git finds no modified tracked files in your working directory. It typically occurs when you have only untracked files, or your working directory is already clean.

Quick fix

Fixes No local changes to save

git status
  1. Check your current Git status
  2. Include untracked files in the stash
  3. Stage files before stashing
  4. Include ignored files as well
git — error
git status
No local changes to save

What this error means

When Git displays "No local changes to save," it means the stash command found nothing to stash. By default, `git stash` only saves changes to files that Git is already tracking (files that have been previously committed or staged). This is not an error in the traditional sense—it is informational feedback. Git is telling you that your working directory has no modifications to tracked files that need to be temporarily stored. The most common scenario is when you have created new files but haven't staged them yet. These untracked files are invisible to the default stash operation. Similarly, if you already committed or stashed all your changes, your working directory will be clean and there will be nothing left to stash.

Typical symptoms

  • Running git stash returns "No local changes to save" instead of creating a stash entry
  • git stash list shows no new stash was created
  • You have new files in your directory but git stash ignores them
  • git status shows untracked files but stash says no changes to save

Common causes

  1. Working directory is clean with no modifications to tracked files
  2. You have only untracked files (new files not yet added to Git)
  3. Changes were already committed before attempting to stash
  4. Changes were already stashed previously
  5. You are in a subdirectory and there are no changes in that path

How to fix "No local changes to save"

1Check your current Git status

First, verify what Git sees in your working directory:

bash
git status

If the output shows "nothing to commit, working tree clean," your directory truly has no changes to stash. If you see files listed under "Untracked files," those are the files being ignored by the default stash command.

2Include untracked files in the stash

To stash untracked files (new files you haven't added yet), use the -u or --include-untracked flag:

bash
git stash -u
# or
git stash --include-untracked

This tells Git to also stash files that are not yet tracked.

3Stage files before stashing

Alternatively, you can stage your new files first, then stash:

bash
git add .
git stash

Once files are staged, they are considered "changes" that git stash will pick up.

4Include ignored files as well

If you also need to stash files that are in your .gitignore, use the -a or --all flag:

bash
git stash -a
# or
git stash --all

This stashes tracked changes, untracked files, AND ignored files. Use with caution as it may include build artifacts or dependencies.

5Verify the stash was created

After running the appropriate stash command, confirm it worked:

bash
git stash list

You should see an entry like stash@{0}: WIP on main: abc1234 Your last commit message.

Advanced notes

### Understanding Git Stash Behavior

The stash command creates a commit-like object that stores your working directory state. By default, it only considers:
- Modified tracked files (changes not yet staged)
- Staged changes (in the index)

It explicitly excludes:
- Untracked files (unless -u is used)
- Ignored files (unless -a is used)

### Stash with a Message

When stashing, it helps to add a descriptive message:

bash
git stash push -u -m "WIP: feature X before switching branches"

### Partial Stashing

You can stash specific files only:

bash
git stash push -u path/to/file.js another/file.ts

### Scripting Considerations

If you are writing scripts that use git stash, check the exit code. Git returns exit code 0 even when "No local changes to save" is printed. To detect this programmatically, check if a new stash was created by comparing git stash list before and after, or use git stash push and check if the stash ref changed.

Frequently asked questions

What does "No local changes to save" mean?
When Git displays "No local changes to save," it means the stash command found nothing to stash. By default, git stash only saves changes to files that Git is already tracking (files that have been previously committed or staged). This is not an error in the traditional sense—it is informational feedback.
How do I fix "No local changes to save"?
This message appears when running git stash but Git finds no modified tracked files in your working directory. It typically occurs when you have only untracked files, or your working directory is already clean.
What causes "No local changes to save"?
Working directory is clean with no modifications to tracked files You have only untracked files (new files not yet added to Git) Changes were already committed before attempting to stash
Is the "No local changes to save" error serious?
It is a low-severity error — more of a blocker than a risk. The steps above resolve it.

Official resources & further reading