什么是 git 状态替代! svn状态结果
What is git status alternative for ! svn status result
我正在修改一个脚本,该脚本检查以下结果代码的 svn 状态:!
在文档中我可以看到!对应如下描述:
Item is missing (e.g., you moved or deleted it without using svn). This also indicates that a directory is incomplete (a checkout or update was interrupted).
示例 SVN 结果:
svn status
! trunk/script/test.txt
谁能告诉我 ! 的 git 结果替代项是什么?我检查了 git 文档,但我不确定 svn !对应D.
感谢您的帮助!
SVN 和 Git 在这方面的工作方式略有不同。粗略的 Git 等价物从工作目录中删除,但未暂存。
$ rm this
$ git status
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: this
no changes added to commit (use "git add" and/or "git commit -a")
您可以使用 git status -s
获得一个简短的版本,在这种情况下它是第二列中的 D。
$ git status -s
D this
Git 有一个 "staging area" 可以被认为是建立新提交的地方。您更改了您的工作目录(即磁盘上的文件),然后使用 git add
和 git rm
"stage" 它们。然后 git commit
提交上演的内容。
Git 可以在 Git 之外添加、删除和更改文件。除非明确上演,否则不会提交它们。
$ git rm this
rm 'this'
$ git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
deleted: this
而简写版本是第一列中的 D。
$ git status -s
D this
有关更多信息,请参阅 git status
。
相比之下,SVN 没有暂存区;磁盘上发生的变化就是提交的内容。这样不告诉SVN就删除被跟踪的文件是不正常的;有可能您并不想删除该文件。而且 SVN 提交比 Git.
更难修改和撤消
我正在修改一个脚本,该脚本检查以下结果代码的 svn 状态:!
在文档中我可以看到!对应如下描述:
Item is missing (e.g., you moved or deleted it without using svn). This also indicates that a directory is incomplete (a checkout or update was interrupted).
示例 SVN 结果:
svn status
! trunk/script/test.txt
谁能告诉我 ! 的 git 结果替代项是什么?我检查了 git 文档,但我不确定 svn !对应D.
感谢您的帮助!
SVN 和 Git 在这方面的工作方式略有不同。粗略的 Git 等价物从工作目录中删除,但未暂存。
$ rm this
$ git status
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: this
no changes added to commit (use "git add" and/or "git commit -a")
您可以使用 git status -s
获得一个简短的版本,在这种情况下它是第二列中的 D。
$ git status -s
D this
Git 有一个 "staging area" 可以被认为是建立新提交的地方。您更改了您的工作目录(即磁盘上的文件),然后使用 git add
和 git rm
"stage" 它们。然后 git commit
提交上演的内容。
Git 可以在 Git 之外添加、删除和更改文件。除非明确上演,否则不会提交它们。
$ git rm this
rm 'this'
$ git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
deleted: this
而简写版本是第一列中的 D。
$ git status -s
D this
有关更多信息,请参阅 git status
。
相比之下,SVN 没有暂存区;磁盘上发生的变化就是提交的内容。这样不告诉SVN就删除被跟踪的文件是不正常的;有可能您并不想删除该文件。而且 SVN 提交比 Git.
更难修改和撤消