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