Skip to Content
Git: Mastering Version Control
book

Git: Mastering Version Control

by Ferdinando Santacroce, Aske Olsson, Rasmus Voss, Jakub Narębski
October 2016
Beginner
861 pages
20h 37m
English
Packt Publishing
Content preview from Git: Mastering Version Control

Displaying the file information

While git ls-tree can give information about tree objects in the repository, it can't be used to display information about the index and working area. The git ls-files command can do this, and we will explore this next.

Getting ready

Again, we'll use the data-model repository from the previous example.

How to do it...

For specific file information, we can use the ls-files command to get information about files in the working tree and the staging area. By default, git ls-files will show the files in the staging area, as shown in the following command:

$ git ls-files
README.md
a_sub_directory/readme
another-file.txt
cat-me.txt
hello_world.c

Note this includes all files in the staging area (the tree state at the latest ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Git Version Control Cookbook - Second Edition

Git Version Control Cookbook - Second Edition

Kenneth Geisshirt, Emanuele Zattin(EUR), Aske Olsson, Rasmus Voss
Git Pocket Guide

Git Pocket Guide

Richard E. Silverman

Publisher Resources

ISBN: 9781787123205Supplemental Content