What does the command git clean -f do?
a) Deletes untracked files from the working directory
b) Resets all staged changes
c) Resets the repository to its last commit
d) Deletes remote branches
Answer:
a) Deletes untracked files from the working directory
Explanation:
The git clean -f command removes untracked files from the working directory. These are files that are not part of the version control system. The -f flag stands for “force” and is required to perform this operation.
For example, running git clean -f will delete any untracked files, helping to clean up your working directory when you no longer need those files.
This command is useful for tidying up your workspace, but it should be used with caution, as deleted files cannot be recovered from Git.