Skip to content

Instantly share code, notes, and snippets.

@dcorrea777
Last active April 25, 2022 12:17
Show Gist options
  • Save dcorrea777/6e3022ae023d089938206fdac7be7e3c to your computer and use it in GitHub Desktop.
Save dcorrea777/6e3022ae023d089938206fdac7be7e3c to your computer and use it in GitHub Desktop.
Filtrar e remover arquivos de commits anteriores.

Remover arquivos de commits anteriores

Nesse exemplo estou filtrando pelo arquivo composer.lock e removendo do meu git

git filter-branch \
    --force \
    --index-filter 'git rm --cached --ignore-unmatch ./composer.lock' \
    --prune-empty \
    --tag-name-filter cat -- \
    --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment