gpt4 book ai didi

Git:没有添加到提交但存在未跟踪的文件

转载 作者:IT王子 更新时间:2023-10-29 00:44:02 26 4
gpt4 key购买 nike

我是 Git 的新手并且是第一次使用。如果有人能帮助我,我将不胜感激。我试图在论坛上找到答案,但是有大量的命令出现,但不确定该使用哪一个。

在产品服务器上,如果我执行 git pull,它会给我以下错误:

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

Optimization/language/languageUpdate.php
email_test.php
nothing added to commit but untracked files present (use "git add" to track)
Please move or remove them before you can merge.

我不太确定如何让它发挥作用。如果我删除它们,将从哪里删除它们。感谢您的回复。

最佳答案

这里有两个选择。您可以将未跟踪的文件添加到您的 Git 存储库(如警告消息所建议的那样),或者您可以将这些文件添加到您的 .gitignore文件,如果你想让 Git 忽略它们。

要添加文件,请使用 git add:

git add Optimization/language/languageUpdate.php
git add email_test.php

要忽略这些文件,请将以下行添加到您的 .gitignore:

/Optimization/language/languageUpdate.php
/email_test.php

任何一个选项都应该允许 git pull 之后成功。

关于Git:没有添加到提交但存在未跟踪的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33513174/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com