Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make git show a list of the files that are being tracked?

Tags:

git

Using command line git, how can I make git show a list of the files that are being tracked in the repository?

like image 502
RobertL Avatar asked Mar 25 '13 03:03

RobertL


People also ask

Which command provides the list of tracked files in git?

ls-tree will output all the versioned files.

Which command provide the list of tracked files?

--full-tree makes the command run as if you were in the repo's root directory. -r recurses into subdirectories. Combined with --full-tree, this gives you all committed, tracked files.


2 Answers

If you want to list all the files currently being tracked under the branch master, you could use this command:

git ls-tree -r master --name-only 

If you want a list of files that ever existed (i.e. including deleted files):

git log --pretty=format: --name-only --diff-filter=A | sort - | sed '/^$/d' 
like image 148
Tuxdude Avatar answered Oct 16 '22 01:10

Tuxdude


The files managed by git are shown by git ls-files. Check out its manual page.

like image 21
vonbrand Avatar answered Oct 16 '22 01:10

vonbrand