git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Renaming a repo
@ 2011-04-19 18:02 Hilco Wijbenga
  2011-04-19 18:13 ` Tomas Carnecky
  0 siblings, 1 reply; 3+ messages in thread
From: Hilco Wijbenga @ 2011-04-19 18:02 UTC (permalink / raw)
  To: Git Users

Hi all,

I have a hosted Git repo. As such I don't have the ability to touch
the bare repo itself (should that be relevant). I would like to rename
it though. I'd like to know if my approach below is valid.

1. The current repo is 'abc.git'
2. git clone abc.git
3. Create new hosted repo 'xyz.git'
4. git clone xyz.git
5. Copy abc/{.git,*} into xyz/
6. Replace all occurrences of 'abc.git' with 'xyz.git':
6.a. .git/logs/HEAD:00...00 41..53 Hilco Wijbenga <...> 1299100781
-0800      clone: from git@...:abc.git
6.b. .git/logs/refs/heads/master:00...00 41...53 Hilco Wijbenga <...>
1299100781 -0800 clone: from git@...:abc.git
6.c. .git/config:  url = git@...:abc.git
6.d. .git/FETCH_HEAD:41...53              branch 'master' of ...:abc
7. git push origin master

There are no errors or warnings and a subsequent git clone and git log
also seem to work. Is the repo in a consistent state or will I
experience problems in the future?

Cheers,
Hilco

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Renaming a repo
  2011-04-19 18:02 Renaming a repo Hilco Wijbenga
@ 2011-04-19 18:13 ` Tomas Carnecky
  2011-04-19 18:32   ` Hilco Wijbenga
  0 siblings, 1 reply; 3+ messages in thread
From: Tomas Carnecky @ 2011-04-19 18:13 UTC (permalink / raw)
  To: Hilco Wijbenga; +Cc: Git Users

On 4/19/11 8:02 PM, Hilco Wijbenga wrote:
> Hi all,
>
> I have a hosted Git repo. As such I don't have the ability to touch
> the bare repo itself (should that be relevant). I would like to rename
> it though. I'd like to know if my approach below is valid.
>
> 1. The current repo is 'abc.git'
> 2. git clone abc.git
git clone --mirror abc.git
> 3. Create new hosted repo 'xyz.git'
cd abc; git push --mirror xyz.git

then you are done.
> 4. git clone xyz.git
> 5. Copy abc/{.git,*} into xyz/
> 6. Replace all occurrences of 'abc.git' with 'xyz.git':
> 6.a. .git/logs/HEAD:00...00 41..53 Hilco Wijbenga<...>  1299100781
> -0800      clone: from git@...:abc.git
You can ignore the reflog.
> 6.b. .git/logs/refs/heads/master:00...00 41...53 Hilco Wijbenga<...>
> 1299100781 -0800 clone: from git@...:abc.git
> 6.c. .git/config:  url = git@...:abc.git
> 6.d. .git/FETCH_HEAD:41...53              branch 'master' of ...:abc
> 7. git push origin master
FETCH_HEAD is also mostly irrelevant, as next time you fetch it'll be 
overwritten.
> There are no errors or warnings and a subsequent git clone and git log
> also seem to work. Is the repo in a consistent state or will I
> experience problems in the future?

No idea. But what you did seems much more complicated than necessary.

tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Renaming a repo
  2011-04-19 18:13 ` Tomas Carnecky
@ 2011-04-19 18:32   ` Hilco Wijbenga
  0 siblings, 0 replies; 3+ messages in thread
From: Hilco Wijbenga @ 2011-04-19 18:32 UTC (permalink / raw)
  To: Tomas Carnecky; +Cc: Git Users

On 19 April 2011 11:13, Tomas Carnecky <tom@dbservice.com> wrote:
> On 4/19/11 8:02 PM, Hilco Wijbenga wrote:
>> 1. The current repo is 'abc.git'
>> 2. git clone abc.git
>
> git clone --mirror abc.git
>>
>> 3. Create new hosted repo 'xyz.git'
>
> cd abc; git push --mirror xyz.git
>
> then you are done.

Wow ... stunned silence ...  :-) *That* was easy. I didn't realize I
could work with bare repos like that.

The more I use Git, the more I like it and the more impressed I am.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-04-19 18:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-19 18:02 Renaming a repo Hilco Wijbenga
2011-04-19 18:13 ` Tomas Carnecky
2011-04-19 18:32   ` Hilco Wijbenga

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).