Is it possible to git status and show only modified files?
The 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. I have a scrollback limit set on Ubuntu.
--short or --porcelain to get one-line versions of the status - torek 2012-04-04 20:26
git ls-files -m: which modification(s) do you care about, staged, unstaged, or both - torek 2012-04-04 20:36
You can't do this with git status, but you could use git ls-files -m to show all modified files.
git status | grep modified just as user23186 indicates in their answer - K. Alan Bates 2016-01-18 17:00
git status only on modified files, it's running git status on everything and then using a separate tool to throw away the unwanted info. Your answer also won't work if the user has the git config setting to always use short mode. A more accurate suggestion would have been git status -s | grep '^.M', but even that is just a poor way of accomplishing the same thing as git ls-files -m - Lily Ballard 2016-01-18 19:02
git status." You totally can have git status return only modified files with grep. Of course your suggestion to use ls-files -m will function just fine; its just not as expressive, in my opinion - K. Alan Bates 2016-01-18 19:53
git ls-files -m is not showing anything but git status | grep modified is working - Sandeepan Nath 2016-05-05 11:41
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 - Lily Ballard 2019-01-19 22:15
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).
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 - mxxk 2014-09-12 20:59
git status -uno (http://stackoverflow.com/questions/7008546/command-git-status-u-no-filters-tracked-files-also - mxxk 2014-09-12 21:03
git status -s | awk '{if ($1 == "M") print $2}'
awk '$1 == "M" { print $2 }'Calpau 2015-09-03 15:35
For modified files:
git status | grep modified:
git config --global alias.modified '!git status | grep modified:'Richard Parnaby-King 2016-01-12 11:23
git diff --name-only --diff-filter=M
git diff --cached --name-only --diff-filter=ACMR which does Added, Copied, Modified and Renamed files - qwertzguy 2018-01-30 01:17
git diff --name-only works too.
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
I use git cola. Its a simple and elegant UI client that will show you the modified files and provide you with a diff like shot of the changes you made.
git cola provides you with a GUI where you can visualize which files you modified, which you staged, and even those you don't track. Your question was to use git status only I believe, but I thought git cola can help when that and other things as well. Check this web page from more info: git-cola.github.com/screenshots.html
If you want to list the modified files you could do this:
git log -n1 --oneline --name-status | grep '^M'
To list all modified files use:
git show --stat --oneline HEAD
I was looking for the same info and found following gives modified files:
git status -uno
git statuswill invoke the pager - Lily Ballard 2012-04-04 20:16