暂存区是否会重置到`<commit>`取决于参数`<mode>`(可能修改暂存区index), 工作区是否会改变取决于参数`<mode>`(可能修改工作区working tree). 关于参数`<mode>`(仅介绍`soft`和`hard`): --soft: Does not touch the index file or the working tree at all (but resets the head to `<commit>`, ju...
index:是索引文件,它是连接working tree和commit的桥梁,每当我们使用git add命令来登记后,index file的内容就会改变,此时index file就和working tree同步了。 它还有一个家喻户晓的名字 -「暂存区」 local repository:是「本地仓库」,当我们使用git commit命令提交最新代码时,代码才真正进入git仓库。 git commit -m...
在Git 术语中,工作树(working tree)是仓库当前存在硬盘中的文件,可以更直观但错误地称为「工作目录」;暂存区(staging area)更正确的名称是索引(index),这在理解官方说明时非常重要。 暂存区的通俗理解是,在提交记录前,先把文件添加到暂存区以细致掌控要提交的内容。比如有两个编辑过的文件 A 与文件 B,暂存区的...
workspace:是本地项目的工作目录,属于本地代码发生更新但尚未执行git add命令时的状态,working tree的状态也随之更新 index:是索引文件,它是连接working tree和commit的桥梁,每当我们使用git add命令来登记后,index file的内容就会改变,此时index file就和working tree同步了。 它还有一个家喻户晓的名字 -暂存区 local...
记住git reset不会产生commits,它仅仅更新一个branch(branch本身就是一个指向一个commit的指针)指向另外一个commit(Head和branch Tip同时移动保持一致).其他的仅剩对于index和work tree(working directory)有什么影响。git checkout xxxCommit则只影响HEAD,如果xxxCommit和一个branch tip是一致的话,则HEAD和branch相匹配...
3)、工作树/区(Working tree) 工作区中包含了仓库的工作文件。您可以修改的内容和提交更改作为新的提交到仓库。 4)、暂存区(Staging area) 暂存区是工作区用来提交更改(commit)前可以暂存工作区的变化。 5)、索引(Index) 索引是暂存区的另一种术语。
记住git reset不会产生commits,它仅仅更新一个branch(branch本身就是一个指向一个commit的指针)指向另外一个commit(Head和branch Tip同时移动保持一致).其他的仅剩对于index和work tree(working directory)有什么影响。git checkout xxxCommit则只影响HEAD,如果xxxCommit和一个branch tip是一致的话,则HEAD和branch相匹配...
3)、工作树/区(Working tree)工作区中包含了仓库的工作文件。您可以修改的内容和提交更改作为新的提交到仓库。 4)、暂存区(Staging area)暂存区是工作区用来提交更改(commit)前可以暂存工作区的变化。 5)、索引(Index)索引是暂存区的另一种术语。 6)、签入(Checkin)将新版本复制回仓库 7)、签出(Checkout)...
Overwrite the contents of the files that match the pathspec. When the (most often a commit) is not given, overwrite working tree with the contents in the index. When the is given, overwrite both the index and the working tree with the contents at the . ...
Pro Gitby Scott Chacon and Ben Straub is available toread online for free. Dead tree versions are available onAmazon.com. Latest source Release 2.49.0Release Notes(2025-03-14)Download for Windows Windows GUIsTarballs Mac BuildSource Code