Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list versioned files in git?

Tags:

git

bazaar

I would like to list the versioned files in the root directory of a git repository. To do the same thing in bazaar, you run:

bzr ls --versioned --non-recursive 

How do I do this in git?

like image 436
Christian Oudard Avatar asked Sep 17 '09 20:09

Christian Oudard


People also ask

How do I see files in git repository?

The Git Show command allows us to view files as they existed in a previous state. The version can be a commit ID, tag, or even a branch name. The file must be the path to a file. For example, the following would output a contents of a file named internal/example/module.go file from a tagged commit called “release-23”.


1 Answers

It would be more helpful if you described exactly what listing you want to show. Guessing from the bzr document, I imagine that you want something like this.

git ls-tree --name-only HEAD 

This lists the names of files in the current directory which are currently in the HEAD revision, which should be close to what you are asking for.

like image 115
CB Bailey Avatar answered Sep 23 '22 03:09

CB Bailey