git/list[1] front-page[2] threads[3] people[4] search[5] about
 

How to list files that are pending for commit from a merge, including hand modified files

From
Brent Goodrick <bgoodr@gmail.com>
Date
Feb 21, 2009, 23:20 UTC
Message-ID
<e38bce640902211520j3f3c2787y28640b0ebcba5e27@mail.gmail.com>
Hi,

git-ls-files does not seem to show files pending to be committed. The -m option does seem to work for files that I might have edited outside of git via an editor, but not all of the other ones pending for merge. The -t option "seems" to imply that the info would be shown, but only lists all files in the repo. Only git-status seems to show these files but in a fashion that makes filtering a bit clunky. Is there some way in which to get a listing of the files that git-status shows in its "changes to be committed" section, but not the "Untracked files" section, short of postprocessing the git-status output with sed/awk gymnastics? E.g., the first section of "modified" files and "new file" type files, but not the junk/ directory:

# On branch work # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: .Xmodmap # new file: .some_file # modified: .gitignore # modified: .zone.profile # modified: Vncviewer # new file: bin/gitw-merge-common.sh # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # junk/

Thanks, Brent

Next: Linus Torvalds
Message 1 of 3 in “How to list files that are pending for commit from a merge, including hand modified files”
  1. Brent GoodrickFeb 21, 2009
  2. Linus TorvaldsFeb 21, 2009
  3. Brent GoodrickFeb 22, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.