Debug School

rakesh kumar
rakesh kumar

Posted on

Git:how to what are the file push on single date using commit id

To find out which files were pushed to a Git repository on a single date using a commit ID, you can use the git show command. Here's how:

1.Open a terminal or command prompt window and navigate to the root directory of your Git repository.

2.Identify the commit ID of the commit you want to investigate. You can find the commit ID by running the git log command without any options, and copying the ID of the commit you want to investigate.

3.Type the following command:

git show --name-only --pretty=format: <commit-ID>
Enter fullscreen mode Exit fullscreen mode
git show --name-only --pretty=format: 6f744ffcbb188dc7453e19ba9d6f8c5e867595db
Enter fullscreen mode Exit fullscreen mode

Image description

to know commit-ID use

git log --after="2023-02-17 23:59:59" --before="2023-02-19 00:00:00" --format="%H"
Enter fullscreen mode Exit fullscreen mode

Image description

Replace with the ID of the commit you want to investigate. This command will show the list of files that were modified in the commit.

4.Press Enter to execute the command. Git will display the commit message, followed by the list of files that were modified in the commit.

Note that the --name-only option is used to show only the names of the modified files, and the --pretty=format: option is used to suppress the commit message and show only the file names.

5.If you want to filter the list of files by a single date, you can use the --since and --until options, as described in my previous answers. For example, to show only the files that were modified on February 14th, 2023, you can add --since=2023-02-14 --until=2023-02-15 to the command:

git show --name-only --pretty=format: <commit-ID> --since=2023-02-14 --until=2023-02-15
Enter fullscreen mode Exit fullscreen mode

This command will show only the files that were modified in the commit and between February 14th, 2023 and February 15th, 2023.

Top comments (0)