In this article you will learn that how you can see all files that you are committed in your commit and how to list down all file with there names using git command.
You can use the git show
command to list all the files in a specific commit. The git show
command shows the metadata and content changes of a specific commit.
Here's an example of how you can use the git show
command to list all the files in a specific commit:
git show <commit-hash> --name-only
where <commit-hash
> is the hash of the commit you want to list the files for.
You can also use the git diff
command to list the files that were modified in a specific commit. Here's an example:
git diff --name-only <commit-hash>^..<commit-hash>
You can also use git log
command to list the files that were modified in a specific commit, here's an example :
git log --name-only --pretty=format:'' <commit-hash>
Please note that these commands only list the files that were added, modified or deleted in a specific commit, it doesn't list all files in the repository at that commit.
To see last commit details You can use the git log
command to see the details of the last commit on the current branch.
Here's an example of how you can use the git log
command to see the details of the last commit:
git log -1
This command will show the details of the last commit, including the commit hash, author, date, and commit message.
You can also use the git show
command to see the details of the last commit and the changes made in it:
git show
Git get details of current working head
git show HEAD
You can also use the git diff
command to see the changes made in the last commit, here's an example :
git diff HEAD^..HEAD
These commands will show the details of the last commit, including the commit hash, author, date, commit message, and changes made. It's worth noting that this is the last commit on the current branch, if you want to see the last commit on a specific branch you can specify the branch name after the git log
or git show
command.