Last active
February 23, 2023 16:59
-
-
Save uilian/7beb347d6ea24e80b853fc866a9dc13f to your computer and use it in GitHub Desktop.
Git Utils
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
# find string accross all git revisions | |
git grep "string/regexp" $(git rev-list --all) | |
# diff file between two different branches or tags | |
git diff master 21.5.5.1 src/files/example.txt | |
# show file history | |
git log --stat src/customProperties.json | |
git log --graph src/customProperties.json | |
# edit git history to remove files | |
git filter-branch -f --index-filter "git rm -rf --cached --ignore-unmatch FILE-TO-BE-FORGOTTEN" HEAD | |
# or | |
bfg --delete-files FILE_TO_BE_DELETED | |
# or | |
git-filter-repo --invert-paths --path FILE/TO/BE/DELETED --force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment