Remove File from Entire Git History
Netflix ☯️ Medium Git
Beginner Mode

Start your terminal to use beginner mode.

Scenario

A file named secrets.env containing sensitive credentials exists in the repository's commit history. You need to purge this file from the entire history.

Task

Navigate to /home/interview/repo and rewrite the commit history to permanently remove secrets.env from all commits.

Example

# Before (Sensitive data in history)
$ git log --all --oneline -- secrets.env
a1b2c3d Add secrets file

# After (Clean history)
$ git log --all --oneline -- secrets.env
(no output)

Terminal requires a larger screen

Open this page on a desktop or tablet (≥ 768px) to launch the terminal and practice hands-on.

Linux Terminal Environment

Write and execute your solution in the terminal below.

Sign In

Track

Question Difficulty Company Access
Need more practice in this area? Explore more questions →