git stash - 没有要保存但未跟踪的文件的本地更改

Sno*_*ash 3 git git-stash

我想隐藏一些未跟踪的文件。我试过:

$ git stash
Run Code Online (Sandbox Code Playgroud)

这给了

No local changes to save
Run Code Online (Sandbox Code Playgroud)

跑步git status给出:

$ 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)
Run Code Online (Sandbox Code Playgroud)

有什么建议?

Saj*_*han 5

您需要存储未跟踪的文件。用--include-untracked旗子藏起来。
或者,Add首先,做 stash。

$ git stash --include-untracked

OR,
$ git add .      # add untracked files
$ git stash
Run Code Online (Sandbox Code Playgroud)