git状态 - 是否有一种仅在特定目录中显示更改的方法? [英] git status - is there a way to show changes only in a specific directory?

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

问题描述

我想看到自上次提交以来修改的文件列表,git status显示,但我只关心位于单个目录中的文件。有没有办法做到这一点?我尝试'git status< directory>',但是看起来这样做完全不一样(列出所有更改的文件,就像我之前写的是'git add< directory>')一样)。

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天全站免登陆