<< All Posts
How to keep Git history after renaming or moving files


Have you noticed that after renaming or moving a file git override and create a brand new git history? Lets fix this!

Just use git mv

git mv foo.txt bar.txt
git commit

Easy enough to miss this and just forget it but it will help out while tracking back some issues in the future.


Reference: https://stackoverflow.com/questions/35618507/git-sure-fire-way-to-move-rename-files-while-keeping-the-history



<< All Posts

rodolfo.io

🇧🇷 🇨🇦
Runs on OpenBSD 🐡