GIT-CP(1)
π GIT-CP β bestie, let's copy a file WITHOUT losing its whole story π
okay so this is git-cp, straight out of Git Extras (that's the manual name, now you know π«Ά). She's a tiny icon, but she does something git itself lowkey refuses to do nicely, and honestly? we stan.
β¨ NAME β¨
git-cp β copy a file, but keep its history intact π
πΈ SYNOPSIS πΈ
git-cp <current_filename> <destination_filename>
Two args, that's it. current is the one you already have, destination is the shiny new copy. No cap.
π¦ DESCRIPTION π¦
So here's the tea: git-cp copies a file while keeping its git history. Not me being dramatic, that's literally the whole job description π
.
And why do you care? Because keeping the history means it makes merge conflict handling possible. Yes bestie, the vibes stay connected, the blame log stays valid, the past doesn't just get deleted like a bad group chat. Iconic behaviour, truly.
π EXAMPLES π
Let's say you wanna copy README into README.txt β watch her cook:
$ git cp README README.txt
Slayed. Effortlessly. β¨
π AUTHOR π
Written by RΓ©my Hubscher <hubscher.remy@gmail.com> β give the author their flowers, this person ate π
π REPORTING BUGS π
Found something cursed? (affectionately) Go tell the devs here:
https://github.com/tj/git-extras/issues
no gatekeeping, no lurking, just report it fr fr π
π SEE ALSO π
- <https://github.com/tj/git-extras> β the mother ship, the main character's home base π
- <https://stackoverflow.com/questions/16937359/git-copy-file-preserving-history/44036771#44036771> β the lore, the origin story, iykyk π§
and that's the whole page bestie, you're officially fluent in git-cp now π
this lil manual is part of Git Extras, and the version on deck is dated May 2026 β go copy something and keep its history, periodt. πππ¦
π¦ where this page comes from
- ubuntu stonking: git-extras 7.5.0-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms