此备忘单可能会有所帮助您了解工作树,登台区域和HEAD(当前签出的提交)之间的关系.更重要的是,它告诉您如何操作它们,因为命令确实不直观.The documentation for git-rm contains this short description:What exactly is meant by the working tree and the index, and which local or remote files will be removed? 解决方案 The "working tree" is your checkout of the files sitting on disk.The "index", "staging area", or "cache" (you'll see it referred to as all three) is internal to Git. It's the space you prepare the next commit. When you git add you're copying the files from the working tree to the staging area. When you git commit you're committing what's in the staging area.git rm removes files from both the working tree and the staging area (unless you tell it to just remove from the staging area with --cached).This cheat sheet might help you understand the relationship between the working tree, staging area, and HEAD (the currently checked out commit). More importantly, it tells you how to manipulate them because the commands are really not-intuitive. 这篇关于git-rm通过工作树和索引是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-28 08:00