Git 状态 - 有没有办法只显示特定目录中的更改? [英] Git status - is there a way to show changes only in a specific directory?

查看:30
本文介绍了Git 状态 - 有没有办法只显示特定目录中的更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想查看自上次提交以来修改的文件列表,如 git status 所示,但我只关心位于单个目录中的文件.有没有办法做到这一点?我尝试了 git status ,但它似乎做了一些完全不同的事情(列出所有更改的文件,就像我写了 git add 第一的).

I would like to see a list of files modified since the last commit, as git status shows, but I care only about files located in a single directory. Is there a way to do this? I tried git status <directory>, but it seems this does something completely different (lists all changed files, as they would be if I wrote git add <directory> first).

git-status 的文档并没有说明太多,除了它接受与 git-commit 相同的选项这一事实(但 git-commit 的目的不是显示已更改文件的列表).

The documentation for git-status doesn't tell much, apart from the fact that it accepts the same options that git-commit does (but git-commit's purpose isn't to show lists of changed files).

推荐答案

来自目录内:

git status .

<小时>

你真的可以使用任何路径,使用以下语法:


You can use any path really, use this syntax:

git status <directoryPath>

例如对于路径为my/cool/path/here"的目录

For instance for directory with path "my/cool/path/here"

git status my/cool/path/here

这篇关于Git 状态 - 有没有办法只显示特定目录中的更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆