Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
文件的Git文件状态_Git - Fatal编程技术网

文件的Git文件状态

文件的Git文件状态,git,Git,根据git官方网站: git有4种文件状态。 所以问题是:删除和移动/重命名文件的状态是什么? 当然,如果文件保留在文件系统中,那么在提交之后它将不被跟踪,但在提交之前它已处于删除状态(用于删除)。我认为删除不是真正的文件修改,而是一个事件 > P>可以考虑删除或重命名,就像这个图表中的编辑一样。无论您是在进行内容更改(编辑文件)、元数据更改(例如,设置文件的可执行文件)还是删除它,都会经历相同的工作流 如果您有一个提交到git的文件(在图中处于teal“未修改”状态)并将其删除,那么您现在处于

根据git官方网站:

git有4种文件状态。 所以问题是:删除和移动/重命名文件的状态是什么?
当然,如果文件保留在文件系统中,那么在提交之后它将不被跟踪,但在提交之前它已处于删除状态(用于删除)。我认为删除不是真正的文件修改,而是一个事件

> P>可以考虑删除或重命名,就像这个图表中的编辑一样。无论您是在进行内容更改(编辑文件)、元数据更改(例如,设置文件的可执行文件)还是删除它,都会经历相同的工作流

如果您有一个提交到git的文件(在图中处于teal“未修改”状态)并将其删除,那么您现在处于“已修改”状态。git已检测到此更改:

On branch master
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    deleted:    foo.txt

no changes added to commit (use "git add" and/or "git commit -a")
此时,文件处于红色“暂存”状态。提交此更改时,该文件将不再存在于存储库中

[master 3b58d71] deleted
 1 file changed, 7 deletions(-)
 delete mode 100644 foo.txt
重新创建文件将以灰色的“未跟踪”状态重新开始

分支主机上的

未跟踪的文件:
(使用“git add…”包含在将提交的内容中)
foo.txt
提交时未添加任何内容,但存在未跟踪的文件(使用“git add”跟踪)

围绕此图像的文档是否表明这些是文件的唯一状态?关于git status的文档可能表明还有其他文档:“”=未修改的M=已修改的A=已添加的D=已删除的R=已重命名的C=已复制的U=已更新但未合并谢谢您的详细回答
[master 3b58d71] deleted
 1 file changed, 7 deletions(-)
 delete mode 100644 foo.txt
On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)

    foo.txt

nothing added to commit but untracked files present (use "git add" to track)