1)Untracked files → 文件未被跟踪; (即没有用add命令的情况) 2)Changes to be committed → 文件已暂存,这是下次提交的内容;(用add命令之后或者文件被修改了再用add命令) 3) Changes bu not updated → 文件被修改,但并没有添加到暂存区。如果 commit 时没有带 -a 选项,这个状态下的文件不会被提交。(...
$git commit--amend [master 671f5cc] commit--amend, add file3 files changed,2insertions(+),0deletions(-) create mode100644file2 create mode100644file3 $git status # On branch master nothing to commit (working directory clean) 当然如果最后一次commit的信息在想修改之前已经push上去了,那。。。 ...
总结起来,通过使用”git status”命令可以查看所有被修改的文件。然后,可以使用”git add”命令将被修改的文件加入到暂存区,最后使用”git commit”命令提交文件到本地仓库。这样,你就可以将被修改的文件保存起来并进行版本控制了。 要了解如何查看git中的修改文件(modified files),下面是具体步骤: 1. 使用`git stat...
$ git commit-m'第一次版本提交'[master(root-commit)d32cf1f]第一次版本提交2files changed,4insertions(+)create mode100644README create mode100644hello.php 现在我们已经记录了快照。如果我们再执行 git status: $ git status# On branch masternothing to commit(working directory clean) 以上输出说明我们...
Modified: 文件已修改, 仅仅是修改, 并没有进行其他的操作. 这个文件也有两个去处, 通过git add可进入暂存staged状态, 使用git checkout则丢弃修改过, 返回到unmodify状态, 这个git checkout即从库中取出文件, 覆盖当前修改 Staged: 暂存状态. 执行git commit则将修改同步到库中, 这时库中的文件和本地文件又变...
Untracked files为未入暂存区文件; 当修改后的文件添加至暂存区后,在提交之前再次进行修改后,非暂存区会再次出现该文件,需再次add添加入暂存区,否则直接commit后仓库中的文件不会包含二次修改的内容。 总结 git status 只能查看未传送提交的次数,不能查看具体文件信息; ...
# modified: file1.txt # modified: file2.txt # no changes added to commit (use “git add” and/or “git commit -a”) $ git add file1.txt file2.txt $ git status # On branch main # Changes to be committed: # (use “git restore –staged…” to unstage) ...
git commit可以将暂存区的改动提交到本地git仓库,最后git push可以把本地仓库的改动同步到远端。看起来好像平平无奇对吧,但我们仔细琢磨会发现一个很奇怪的点,那就是既然我们git add和git commit都是提交,只不过是提交的目的地不同,一个是暂存区一个是本地仓库。那么为什么我们不能直接将它们合并呢?我们git add...
Modified:文件已经被修改,并没有进行其他操作。此文件两种去处,通过 git add 加入暂存staged 状态,使用 git checkout 丢弃修改返回到unmodify 状态。git checkout filename 即从库中取出文件,覆盖当前的修改。 staged:暂存状态。执行git commit 将修改同步到库中,此时库中文件和本地文件变为一致。文件变为unimodify...
D - Deleted filesWe see the file we expected is modified. So let's commit it directly:Example git commit -a -m "Updated index.html with a new line" [master 09f4acd] Updated index.html with a new line 1 file changed, 1 insertion(+)Warning...