git - Git/Sourcetree 中未跟踪是什么意思

标签 git atlassian-sourcetree

我编写了很多更改并创建了新组件。现在我必须承担所有这些。但当我转到源代码树时,我遇到了一些新的情况。我必须提交一些更改,但每当我将鼠标悬停在新创建的组件上时,我都会看到“未跟踪”。不知道这是什么以及如何处理。

最佳答案

“未跟踪”仅仅意味着 Git 没有这些文件的记录——它们从未被提交,也没有被添加到暂存区域。

来自Git book :

Remember that each file in your working directory can be in one of two states: tracked or untracked. Tracked files are files that were in the last snapshot, as well as any newly staged files; they can be unmodified, modified, or staged. In short, tracked files are files that Git knows about.

Untracked files are everything else — any files in your working directory that were not in your last snapshot and are not in your staging area.

Adding the files to staging area使用 git add 足以让 Git 开始跟踪它们并将它们显示为"new"。

关于git - Git/Sourcetree 中未跟踪是什么意思,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74872416/

相关文章:

git - Git checkout 的幕后发生了什么?

git - 从 gitolite 到 bitbucket 的脚本化迁移

git - 使用 SSH key 访问 Sourcetree 中的组织存储库

mysql - SourceTree 中 textconv 的自定义差异

windows - git commit 命令的段错误 (Windows)

git - 'git pull origin mybranch' 在 origin 之前留下本地 mybranch N 提交。为什么?

java - Eclipse:工作区中项目的更改未对导入项目的文件夹进行更改

git - 什么可能导致 `git pull` 无法看到远程更改?

git rebase,跟踪 'local' 和 'remote'

git - “git apply”失败,代码为 1 : patch does not apply error in SourceTree on Stage Hunk