Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git: how can I list ALL the files present at a given commit?

Tags:

git

list

show

I'd like to get a list of all the files present in git at a given point.

I've tried issuing something like:

git show --pretty="format:" --name-only f21b25e76d146

This only shows the files that where added though, not ALL the files present in the working directory at that specific commit. Is there a way to do so?

Thanks a lot in advance.

like image 944
lucacerone Avatar asked Mar 13 '12 13:03

lucacerone


People also ask

How do I list all the files in a commit?

In Git, we can use git show commit_id --name-only to list all the committed files that are going to push to the remote repository.

Can you display a list of files added or modified in a specific commit?

If you simply run git log command then you will get list of all Commits done till now. But if you use git log -p command, then you will see all the Commits along with the changes done in each Commit.

How do I list files in git?

This command will list the files that are being tracked currently. If you want a list of files that ever existed use: git log --pretty=format: --name-only --diff-filter=A | sort - | sed '/^$/d'This command will list all the files including deleted files.

How do you check details of a commit in git?

To pull up a list of your commits and their associated hashes, you can run the git log command. To checkout a previous commit, you will use the Git checkout command followed by the commit hash you retrieved from your Git log.


1 Answers

git ls-tree -r --name-only --full-tree f21b25e76d146

like image 116
Michael Mior Avatar answered Nov 04 '22 12:11

Michael Mior