List files in any branch in git
Mathieu PATUREL

Mathieu PATUREL @math2001

About: Don't have much inspiration for an original bio right now...

Location:
Australia
Joined:
Apr 23, 2017

List files in any branch in git

Publish Date: Sep 25 '17
15 2

List entire branch content

~/my/repo $ git ls-tree mybranch -r --name-only
.gitignore
LICENSE
README.md
cli.js
demo.gif
index.html
live-svg.svg
package.json
server.js
tests/cli.js
Enter fullscreen mode Exit fullscreen mode

List only one folder's content

You don't need grep!

~/my/repo $ git ls-tree mybranch:test -r --name-only
tests/cli.js
Enter fullscreen mode Exit fullscreen mode

More informations about git ls-tree.

Hope it'll save you some time! 😜

Comments 2 total

Add comment