3

I'd like to stash some Untracked files. I tried:

$ git stash

which gave

No local changes to save

Running git status gives:

$ git status
On branch develop
Your branch is up-to-date with 'origin/develop'.
Untracked files:
  (use "git add <file>..." to include in what will be committed)

    dir/

nothing added to commit but untracked files present (use "git add" to track)

Any suggestions?

Snowcrash
  • 80,579
  • 89
  • 266
  • 376
  • 2
    Possible duplicate of [How do you stash an untracked file?](http://stackoverflow.com/questions/835501/how-do-you-stash-an-untracked-file) – Tim Biegeleisen Feb 20 '17 at 12:53

1 Answers1

8

You need to stash untracked files. Stash with --include-untracked flag.
Or, Add first then, do stash.

$ git stash --include-untracked

OR,
$ git add .      # add untracked files
$ git stash
Sajib Khan
  • 22,878
  • 9
  • 63
  • 73
  • Note that a stash that includes untracked files may be harder to restore later (should one wish to do so). – torek Feb 20 '17 at 19:22