LinuxCommandLibrary

git-cp

Copy an existing file to a new location, preserving history.

TLDR

Copy an existing file in a Git repo, staying in the same directory

$ git cp [file] [new_file]
copy


Copy an existing file in a Git repo and place it elsewhere
$ git cp [path/to/file] [path/to/new_file]
copy

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

REPORTING BUGS

<https://github.com/tj/git-extras/issues>

SEE ALSO

<https://github.com/tj/git-extras> <https://stackoverflow.com/questions/16937359/git-copy-file-preserving-history/44036771#44036771>

AUTHOR

Written by Rémy Hubscher <hubscher.remy@gmail.com>

Copied to clipboard