Launch price: every exam for $29.99 a year, for the first 300 buyers. See the price

CertStreak
Menu

Remove specific data from source control

A worked example

Single answer

A developer must delete a file that was committed by mistake from the entire history of a Git repository. Which tool or command is commonly used for this kind of history cleanup and is simpler to use than git filter-branch?

Choose one answer
Why

BFG Repo-Cleaner is the history cleanup tool that matches the comparison with git filter-branch. It provides --delete-files for targeting unwanted files. Git LFS addresses binary file storage, while git restore and git cherry-pick perform the recovery operations described in the source.

  • Not correct: git cherry-pick. The source describes git cherry-pick as applying a selected commit's changes to the current branch. Applying those changes does not purge a file from repository history.
  • Not correct: git restore. The source describes git restore as discarding uncommitted local changes and restoring a file to its committed state. That does not remove the file from committed history.
  • Not correct: Git LFS. The source recommends Git LFS for storing large binary files that change frequently. The source identifies BFG Repo-Cleaner as the tool matching the history cleanup requirement.
  • Correct: BFG Repo-Cleaner. The source identifies BFG Repo-Cleaner as an open-source repository cleanup tool that is simpler than git filter-branch. Its --delete-files option targets unwanted files.

Practise this topic until it's automatic.

Ten questions a day, every answer explained, and misses that come back until you beat them.

Start free