git 查看删除的文件
$ git log test.md
fatal: 有歧义的参数 ‘test.md’:未知的版本或路径不存在于工作区中。
使用 ‘–’ 来分隔版本和路径,例如:
‘git <命令> [<版本>…] – [<文件>…]’
$ git log --stat --oneline --full-history – test.md
bf46627 (HEAD -> master, origin/master, origin/HEAD) remove test.md
test.md | 1 -
1 file changed, 1 deletion(-)
9d5c661 add test.md
test.md | 1 +
1 file changed, 1 insertion(+)
检查远程文件中是否存在
$ git cat-file -e origin/master:welcome.txt && echo welcome exists
welcome exists
$ git cat-file -e origin/master:welcome.txt2 || echo welcome2 not exists
fatal: 路径 ‘welcome.txt2’ 不在 ‘origin/master’ 中
welcome2 not exists