Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git-cp: add page #5947

Merged
merged 13 commits into from
May 12, 2021
13 changes: 13 additions & 0 deletions pages/common/git-cp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# git cp

> Copy an existing file to a new location, preserving history.
> Part of `git-extras`.
> More information: <https://github.com/tj/git-extras/blob/master/Commands.md#git-cp>.

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

`git cp {{file}} {{new_file}}`
CleanMachine1 marked this conversation as resolved.
Show resolved Hide resolved

- Copy an existing file in a Git repo and move it elsewhere:

`git cp {{path/to/file}} {{/directory/to/new_file}}`
CleanMachine1 marked this conversation as resolved.
Show resolved Hide resolved