Is it possible to have git status only show the modified files due, in my case, to having too many staged files?
19 Answers
You can't do this with git status, but you could use git ls-files -m to show all modified files.
10 Comments
git status | grep modified just as user23186 indicates in their answer.git ls-files -m is not showing anything but git status | grep modified is working.git diff --name-only --diff-filter=M HEAD would show just modified files for both staged and unstaged, though you should check the docs on --diff-filter to see what other filter types you might want to add.It looks like git status -uno will show you only files that git is tracking, without showing anything else in the directory. Not exactly what you asked for, but perhaps accomplishes the same thing (getting a readable-length list of files that git tracks).
2 Comments
git status -u no does not show (1) tracked files which are modified, nor (2) tracked files which are staged. I've verified this with git versions 1.8.5.2 and 1.9.4.git status -uno (stackoverflow.com/questions/7008546/…)For modified files:
git status | grep modified: 2 Comments
git config --global alias.modified '!git status | grep modified:'git status -uno. If you prefer more terse output, then use git status -s -uno or git status -suno. Note: It's VERY IMPORTANT not to use a space between the -u option and its argument, no.git status -s | awk '{if ($1 == "M") print $2}' 1 Comment
awk '$1 == "M" { print $2 }'git diff --name-only --diff-filter=M
4 Comments
git diff --cached --name-only --diff-filter=ACMR which does Added, Copied, Modified and Renamed files.git diff HEAD --name-only --diff-filter=M (which is also different from this answer).To list the modified files use:
git ls-files -m If you want just the basename (no path) then you can pipe each result to the basename command using xargs, line by line:
git ls-files -m | xargs -L 1 basename 1 Comment
I was looking for the same info and found following gives modified files:
git status -uno 1 Comment
git status -uno --porcelain adds nice output for parsing scriptThe problem is i have too many staged files that i don't want to commit or gitignore at the moment and i can't scroll up.
While this may not directly answer the question of listing only modified files, it may help limit the number of files that are listed.
You can pass a path to git status to limit the output to a specific folder in the repo.
For example:
git status app git status spec git status src/components Comments
I use this command :
$ git status -sb -uno | grep -v "^\sD\s" And the output looks like this :
## master...origin/master M GNUmakefile M include/mp4v2/project.h 3 Comments
\M git status -uno -sb | grep M\Update
open the .gitconfig
[user] name = ... email = ... [alias] # 👇 add below code mySt = "!f() {\ inputType=${1:-" "};\ git status -s | grep "\\ $inputType" |\ sed -e 's/ / /' ;\ }; f" explain: https://stackoverflow.com/a/62772985/9935654
usage
git mySt M: show modified:
git mySt M *.md: Show all *.md, which was modified.
git mySt D: deleted:
git mySt: same as thegit status -s
OS: windows
The following command will display all lines containing "modified:", "renamed:" or "new file:"
git status | findstr "modified: renamed: new file:" If you want to specified file type: (for example *.py *.ini)
git status *.py *.ini | findstr "modified: renamed: new file:" If you think it’s too much trouble typing so much:
create a batch file (for example:
st.bat)write contents as following:
@echo off :: st.bat (this line doesn't necessarily. ( just let you know the scripts name.)) git status %~1 | findstr "modified: renamed: new file:"add environment path which contains your batch file. (
st.bat)usage
st.bat "*.py *.ini"(note: if type > 1 then must add the semicolon)
OS: LINUX
as @Lance says you can try
git status | grep modified:

git statuswill invoke the pager.--shortor--porcelainto get one-line versions of the status.git ls-files -m: which modification(s) do you care about, staged, unstaged, or both?