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

Re: initializing remote clone but files already there

From
Petr Baudis <pasky@suse.cz>
Date
Jul 20, 2006, 21:32 UTC
Message-ID
<20060720213245.GM13776@pasky.or.cz>
In-Reply-To
<f36b08ee0607201241t6160b1eqb4f0b255b02499a7@mail.gmail.com>

Dear diary, on Thu, Jul 20, 2006 at 09:41:48PM CEST, I got a letter where Yakov Lerner <iler.ml@gmail.com> said that...

Show 6 quoted lines
> There are two machines with slow ssh access. The
> both have copy of same filetree that was synchronized
> previously vi rsync. How do I put both trees under git control
> as if they were clone on one other *but* (1) without creating
> branches and (2) without copying files over (files are already
> there) ?

Put one tree under the git control and examine the initial commit in detail (cg-log -v or git show --pretty=fuller or whatever). Now you want to perform the initial commit in the other tree with exactly the same metadata; log message should be easy, to carry over all the times and stuff, you need to set GIT_AUTHOR_{NAME,EMAIL,DATE} and GIT_COMMITTER_<dtto> based on the other initial commit details. That should result in a same commit id. Then you need to just set up remote branch origin just like you would set up any other remote branch.

Good luck,
-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Snow falling on Perl. White noise covering line noise.
Hides all the bugs too. -- J. Putnam
Previous: Yakov Lerner
Message 2 of 2 in “initializing remote clone but files already there”
  1. Yakov LernerJul 20, 2006
  2. Petr BaudisJul 20, 2006

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.