Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用以下命令,我从 git index 中删除了几个目录:
git rm -r --cached <your directory>
现在我怎样才能将那些未跟踪的目录再次添加到 git index 中?
只需使用以下命令将它们再次添加到您的索引中git add:
git add
git add <your directory>
请注意,这将添加所有文件,而不仅仅是那些使用您之前的命令删除的文件。没有办法只撤消您的命令。