Skip to content

git-cp does not preserve file history #985

@joyt

Description

@joyt

The man page states that using git-cp will "Copy a file keeping its history", however, the history is not preserved.

Repro steps:

  1. Use git-cp to copy an existing file, e.g. `git cp
  2. Do git diff HEAD^ - see that git considers the entire copied file to be completely new code authored by the current user

As you can see in the source code, rather than following the process referenced by the man page, the current implementation just simply copies the file using cp -r and adds a commit without any steps to keep the git file history.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions