{"thread":{"id":"27135","subject":"Renaming a repo","startedAt":"2011-04-19T18:02:36Z","lastAt":"2011-04-19T18:32:04Z","messageCount":3,"participants":["Hilco Wijbenga","Tomas Carnecky"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"166093","messageId":"BANLkTiknSbWrskhGLWUBEq1=9KV4hC3ttA@mail.gmail.com","threadId":"27135","inReplyTo":null,"subject":"Renaming a repo","fromName":"Hilco Wijbenga","fromEmail":"hilco.wijbenga@gmail.com","sentAt":"2011-04-19T18:02:36Z","receivedAt":"2011-04-19T18:02:36Z","isPatch":false,"sender":{"key":"hilco.wijbenga@gmail.com","avatar":null},"body":"Hi all,\n\nI have a hosted Git repo. As such I don't have the ability to touch\nthe bare repo itself (should that be relevant). I would like to rename\nit though. I'd like to know if my approach below is valid.\n\n1. The current repo is 'abc.git'\n2. git clone abc.git\n3. Create new hosted repo 'xyz.git'\n4. git clone xyz.git\n5. Copy abc/{.git,*} into xyz/\n6. Replace all occurrences of 'abc.git' with 'xyz.git':\n6.a. .git/logs/HEAD:00...00 41..53 Hilco Wijbenga <...> 1299100781\n-0800      clone: from git@...:abc.git\n6.b. .git/logs/refs/heads/master:00...00 41...53 Hilco Wijbenga <...>\n1299100781 -0800 clone: from git@...:abc.git\n6.c. .git/config:  url = git@...:abc.git\n6.d. .git/FETCH_HEAD:41...53              branch 'master' of ...:abc\n7. git push origin master\n\nThere are no errors or warnings and a subsequent git clone and git log\nalso seem to work. Is the repo in a consistent state or will I\nexperience problems in the future?\n\nCheers,\nHilco\n"},{"id":"166097","messageId":"4DADD0C4.4010106@dbservice.com","threadId":"27135","inReplyTo":"BANLkTiknSbWrskhGLWUBEq1=9KV4hC3ttA@mail.gmail.com","subject":"Re: Renaming a repo","fromName":"Tomas Carnecky","fromEmail":"tom@dbservice.com","sentAt":"2011-04-19T18:13:24Z","receivedAt":"2011-04-19T18:13:24Z","isPatch":false,"sender":{"key":"tom@dbservice.com","avatar":"https://gravatar.com/avatar/900a300bdd1a8bbe086008ad78210bbee2ad2803b7d50a5cba04c1e9404bd6d2?d=mp&s=160"},"body":"On 4/19/11 8:02 PM, Hilco Wijbenga wrote:\n> Hi all,\n>\n> I have a hosted Git repo. As such I don't have the ability to touch\n> the bare repo itself (should that be relevant). I would like to rename\n> it though. I'd like to know if my approach below is valid.\n>\n> 1. The current repo is 'abc.git'\n> 2. git clone abc.git\ngit clone --mirror abc.git\n> 3. Create new hosted repo 'xyz.git'\ncd abc; git push --mirror xyz.git\n\nthen you are done.\n> 4. git clone xyz.git\n> 5. Copy abc/{.git,*} into xyz/\n> 6. Replace all occurrences of 'abc.git' with 'xyz.git':\n> 6.a. .git/logs/HEAD:00...00 41..53 Hilco Wijbenga<...>  1299100781\n> -0800      clone: from git@...:abc.git\nYou can ignore the reflog.\n> 6.b. .git/logs/refs/heads/master:00...00 41...53 Hilco Wijbenga<...>\n> 1299100781 -0800 clone: from git@...:abc.git\n> 6.c. .git/config:  url = git@...:abc.git\n> 6.d. .git/FETCH_HEAD:41...53              branch 'master' of ...:abc\n> 7. git push origin master\nFETCH_HEAD is also mostly irrelevant, as next time you fetch it'll be \noverwritten.\n> There are no errors or warnings and a subsequent git clone and git log\n> also seem to work. Is the repo in a consistent state or will I\n> experience problems in the future?\n\nNo idea. But what you did seems much more complicated than necessary.\n\ntom\n"},{"id":"166096","messageId":"BANLkTimeufOo1eLESqooaf+zN+16+mUJCA@mail.gmail.com","threadId":"27135","inReplyTo":"4DADD0C4.4010106@dbservice.com","subject":"Re: Renaming a repo","fromName":"Hilco Wijbenga","fromEmail":"hilco.wijbenga@gmail.com","sentAt":"2011-04-19T18:32:04Z","receivedAt":"2011-04-19T18:32:04Z","isPatch":false,"sender":{"key":"hilco.wijbenga@gmail.com","avatar":null},"body":"On 19 April 2011 11:13, Tomas Carnecky <tom@dbservice.com> wrote:\n> On 4/19/11 8:02 PM, Hilco Wijbenga wrote:\n>> 1. The current repo is 'abc.git'\n>> 2. git clone abc.git\n>\n> git clone --mirror abc.git\n>>\n>> 3. Create new hosted repo 'xyz.git'\n>\n> cd abc; git push --mirror xyz.git\n>\n> then you are done.\n\nWow ... stunned silence ...  :-) *That* was easy. I didn't realize I\ncould work with bare repos like that.\n\nThe more I use Git, the more I like it and the more impressed I am.\n"}]}