Created
May 13, 2021 00:41
-
-
Save kevinhooke/389b4e69d3f2ea7c95dc248e8cdd91f3 to your computer and use it in GitHub Desktop.
git list files on a commit and delete files and all history
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# diff changed files against previous commit - this doesn't show anything for a first commit | |
git diff-tree --no-commit-id --name-only -r commithash | |
# list all files on a commit | |
git ls-tree --name-only -r commithash | |
# delete a file from all commit history | |
git filter-branch --tree-filter "rm -f filename" HEAD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment