A Linux administrator retrieved a repository of files from a Git server using git clone.
The administrator wants to see if a configuration file was added to the repository.
Which of the following Git arguments should be used to see the recent modifications?
Click on the arrows to vote for the correct answer
A. B. C. D.D.
The correct Git argument to use in this scenario is B. log.
When a Linux administrator retrieves a repository of files from a Git server using git clone, the repository is stored on the local machine, and the administrator can view the repository's history to see if any recent modifications were made.
The git log
command is used to view the repository's commit history, which shows a list of all the changes that have been made to the repository. By default, the git log
command shows the most recent commits first, and includes information such as the commit message, author, and date.
To search for a specific configuration file in the commit history, the administrator can use the -- <file>
option to limit the results to only the commits that modified that file. For example, the command git log -- <filename>
will show only the commits that modified the file named <filename>
.
In contrast, the git fetch
command downloads new changes from the remote repository to the local repository, but it does not integrate them into the current working branch. The git pull
command combines git fetch
with git merge
, which integrates the new changes into the current working branch, but neither of these commands is useful for viewing recent modifications to a specific file.
Finally, the git init
command is used to create a new Git repository in an empty directory, so it is not relevant to this scenario.