【发布时间】:2022-06-30 21:49:30
【问题描述】:
使用git status --porcelain <file> 我可以检查文件是否
被修改、删除、添加、...
https://git-scm.com/docs/git-status#_short_format
如果文件在本地被修改和提交,git status --porcelain <file> 不会返回任何值。
使用git status <file>,我知道整个 repo 是 x 提前提交,但这是针对整个 repo 而不是仅针对单个文件。
如果单个文件已提交但未推送,我如何检查它。
【问题讨论】:
-
您可以查看是否已推送提交,但不能查看文件。或者您可以检查远程中是否存在文件根本。见How do I check if a file exists in a remote?
标签: git