Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GIT list of new/modified/deleted files

Tags:

git

file

list

diff

Is there a way to get the list of all new/deleted/modified directories/files in local/remote repository w.r.t each other in GIT ?

like image 283
Jean Avatar asked Mar 28 '12 20:03

Jean


People also ask

How do you see what files were changed in git?

To find out which files changed in a given commit, use the git log --raw command.

Does git show deleted files?

Listing all the deleted files in all of git history can be done by combining git log with --diff-filter . The log gives you lots of options to show different bits of information about the commit that happened at that point.

How do I display only the names of changed files?

git show --name-only SHA1 . you can also do: git diff --name-only HEAD@{3} HEAD@{0} for the exact commits you want to compare.

Where is locally modified files git?

I'm not sure what you mean by with respect to each other, but if you want an individual listing (e.g. all modified files) you can use git ls-files with the right flags (for modified files it's -m ). If you want all of this info at once, you can use git status --porcelain to get a script-parsable output of the status.


2 Answers

I'm not sure what you mean by with respect to each other, but if you want an individual listing (e.g. all modified files) you can use git ls-files with the right flags (for modified files it's -m). If you want all of this info at once, you can use git status --porcelain to get a script-parsable output of the status.

like image 31
Lily Ballard Avatar answered Sep 19 '22 15:09

Lily Ballard


The best way to list these file is using git status --porcelain

For example: To remove previously deleted files:

git status --porcelain | awk 'match($1, "D"){print $2}' | xargs git rm 
like image 115
Alex Sharapov Avatar answered Sep 19 '22 15:09

Alex Sharapov