git-cp - Man Page
Copy a file keeping its history
Examples (TL;DR)
- Copy an existing file in a Git repo, staying in the same directory:
git cp file new_file
- Copy an existing file in a Git repo and place it elsewhere:
git cp path/to/file path/to/new_file
Synopsis
git-cp <current_filename> <destination_filename>
Description
Copy a file keeping its git history. This allows merge conflict handling.
Examples
Copy README into README.txt
$ git cp README README.txt
Author
Written by Rémy Hubscher <mailto:hubscher.remy@gmail.com>
Reporting Bugs
See Also
<https://github.com/tj/git-extras>
<https://stackoverflow.com/questions/16937359/git-copy-file-preserving-history/44036771#44036771>
Referenced By
March 2020 Git Extras