git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: possible 'git cp'/how does git detect copies

From
Miklos Vajna <vmiklos@frugalware.org>
Date
Jun 27, 2008, 13:09 UTC
Message-ID
<20080627130945.GN29404@genesis.frugalware.org>
In-Reply-To
<20080627130006.GC17898@artemis.madism.org>
On Fri, Jun 27, 2008 at 03:00:06PM +0200, Pierre Habouzit <madcoder@debian.org> wrote:
>   If you really need it, you can and an alias alias.cp=!cp and be done
> with it ;P

Actually that's not that easy. git-mv moves untracked files and adds tracked files to the index as well. So such a git-cp would have to copy tracked and untracked files, and add tracked files to the index.

I did it in the past:
http://thread.gmane.org/gmane.comp.version-control.git/72388/focus=73347
but then we agreed about it's better not encouraging copy-and-paste.
Previous: Pierre HabouzitNext: Johannes Sixt
Message 5 of 6 in “possible 'git cp'/how does git detect copies”
  1. Mircea BardacJun 27, 2008
  2. Santi BéjarJun 27, 2008
  3. Mircea BardacJun 27, 2008
  4. Pierre HabouzitJun 27, 2008
  5. Miklos VajnaJun 27, 2008
  6. Johannes SixtJun 27, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.