Q:Git:未跟踪的文件

问题描述 投票:1回答:1

enter image description here

~ 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) 
git zsh oh-my-zsh git-untracked
1个回答
0
投票
Powerlevel10k FAQ

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

使用Lean,

Classic或Rainbow样式时,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                                           |

另请参见:How do I change the format of Git status?

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

git -C ~ config status.showuntrackedfiles no

这将产生多种效果:

关于.Trash权限的警告将消失。

    git status将更快。
  • git status不会列出49个未跟踪的文件。
  • [?49将从您的提示中消失。
  • 您可以使用以下命令撤消上述命令:
  • git -C ~ config --unset status.showuntrackedfiles
  • © www.soinside.com 2019 - 2024. All rights reserved.