1

~ master ?49 ❯ git status
> warning: could not open directory '.Trash/': Operation not permitted
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)

~ master ?49 ❯
> nothing added to commit but untracked files present (use "git add" to track)

是什么?49意思?它与Git有关系吗?

另外,当我输入git status它时,它会列出我所有的文件并给我这个:

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

1 回答 1

0

?49在您的提示中表示当前 Git 存储库中有 49 个未跟踪文件。

来自Powerlevel10k 常见问题解答

问:Git 状态中不同的符号是什么意思?

当使用LeanClassicRainbow风格时,Git 状态可能如下所示:

feature:master ⇣42⇡42 *42 merge ~42 +42 !42 ?42

传奇:

| Symbol  | Meaning                                                           | Source                                               |
| --------| ------------------------------------------------------------------| ---------------------------------------------------- |
| feature | current branch; replaced with #tag or @commit if not on a branch  | git status                                           |
| master  | remote tracking branch; only shown if different from local branch | git rev-parse --abbrev-ref --symbolic-full-name @{u} |
| ⇣42     | this many commits behind the remote                               | git status                                           |
| ⇡42     | this many commits ahead of the remote                             | git status                                           |
| *42     | this many stashes                                                 | git stash list                                       |
| merge   | repository state                                                  | git status                                           |
| ~42     | this many merge conflicts                                         | git status                                           |
| +42     | this many staged changes                                          | git status                                           |
| !42     | this many unstaged changes                                        | git status                                           |
| ?42     | this many untracked files                                         | git status                                           |

另请参阅:如何更改 Git 状态的格式?

如果您在主目录的根目录创建了一个 Git 存储库来存储点文件,您可能希望忽略其中未跟踪的文件。您可以通过执行以下命令来实现此目的:

git -C ~ config status.showuntrackedfiles no

这将产生几个影响:

  • 关于权限的警告.Trash将消失。
  • git status会更快。
  • git status不会列出 49 个未跟踪的文件。
  • ?49将从您的提示中消失。

您可以使用以下命令撤消上述命令:

git -C ~ config --unset status.showuntrackedfiles
于 2019-12-01T12:12:03.173 回答