Last active
September 5, 2023 21:19
-
-
Save diodonfrost/fe1dbee74682f089fb56f01b1389fabe to your computer and use it in GitHub Desktop.
Move folder and keep Git history
This file contains hidden or 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
| # Move/Rename folder "foo/my-old-folder" to "foo/my-new-folder" and keep history | |
| git filter-branch -f --tree-filter 'test -d foo/my-old-folder && mv foo/my-old-folder foo/my-new-folder || echo "Nothing to do"' HEAD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment