Get list of changed files in working directory (Working directory)

Asked

Viewed 5,695 times

3

When the command is executed git diff in the terminal opens a window that shows the contents of the files with their changes. From there I can know which files have been changed. The problem with this method is that to know which or how many files have been changed you have to go to the end of the last file presented.

I need a simpler resource. A resource that shows only the name of the changed files.

What the commando used to list the files that were changed but not committed?

4 answers

6


I get the impression that you only want the modified files. No "untracked" or "staged" files. In this case use

git ls-files --modified

or

git ls-files -m

Obs: the files in the index have not been commited yet. But it is unclear if you want to list these files. As your example is the output of git diff I’m guessing not.

2

The command to view the changed files that were not committed is git status, as an example below:

inserir a descrição da imagem aqui

In the link below, you can find more information about recording changes in the repository and checking the status of your files:

Git Essential - Saving Changes to the Repository

0

To know which branch files are not yet in master, you can use this command:

git diff --name-only master

This is useful to know which files should go into production, for example.

0

The command to show the status of the repository listing all changed files and new files (untracked files) is:

git status

Browser other questions tagged

You are not signed in. Login or sign up in order to post.