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

Re: What about git cp ?

From
Remi Vanicat <vanicat@debian.org>
Date
Feb 3, 2008, 18:55 UTC
Message-ID
<87hcgplvjh.dlv@maison.homelinux.org>
In-Reply-To
<38b2ab8a0802031023y2ed7a5aax6d3c404b08757a4d@mail.gmail.com>
"Francis Moreau" <francis.moro@gmail.com> writes:
Show 6 quoted lines
> Hello,
>
> I'm looking for a something which could be done by a git-cp command.
>
> I'd like to copy a file with its history to a new  file but want to
> keep the old one,

Git don't attach history to a file, but to a content. Just do a: cp foo bar git add bar git commit -m "copying foo to bar"

And it will be done, and when needed, git will be able to know that this was a copy.

-- 
Rémi Vanicat
Previous: Miklos Vajna
Message 14 of 14 in “What about git cp ?”
  1. Francis MoreauFeb 3, 2008
  2. Matthieu MoyFeb 3, 2008
  3. Jakub NarebskiFeb 3, 2008
  4. Implement git-cp.Miklos Vajna, Feb 10, 2008
  5. Johannes SchindelinFeb 10, 2008
  6. Junio C HamanoFeb 10, 2008
  7. Johannes SchindelinFeb 10, 2008
  8. Miklos VajnaFeb 10, 2008
  9. Robin RosenbergFeb 10, 2008
  10. Jakub NarebskiFeb 11, 2008
  11. Matthieu MoyFeb 11, 2008
  12. Miklos VajnaFeb 11, 2008
  13. Implement git-cp.Miklos Vajna, Feb 10, 2008
  14. Remi VanicatFeb 3, 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.