LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

git-cp

Copy files preserving git history

TLDR

Copy a file keeping its history
$ git cp [source_file] [destination_file]
copy
Copy a file to a different directory keeping its history
$ git cp [path/to/source] [path/to/destination]
copy

SYNOPSIS

git-cp currentfilename destinationfilename

DESCRIPTION

git cp is a command from git-extras that copies a file while preserving its Git history. This allows merge conflict handling on the copied file.Unlike a simple filesystem copy followed by git add (which creates a new file with no history), git cp leverages Git's ability to detect file copies through content similarity. When viewing the history of the copied file with git log --follow --find-copies, Git can trace back to the original file's commits.This is particularly useful when creating new files based on templates or when splitting functionality from one file into multiple files while maintaining attribution and history.

INSTALL

sudo apt install git
copy
sudo dnf install git
copy
sudo pacman -S git
copy
sudo apk add git
copy
sudo zypper install git
copy
brew install git
copy
nix profile install nixpkgs#git
copy

SEE ALSO

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid