Re: Renaming a repo
- From
Tomas Carnecky <tom@dbservice.com>
- Date
- Apr 19, 2011, 18:13 UTC
- Message-ID
- <4DADD0C4.4010106@dbservice.com>
- In-Reply-To
- <BANLkTiknSbWrskhGLWUBEq1=9KV4hC3ttA@mail.gmail.com>
On 4/19/11 8:02 PM, Hilco Wijbenga wrote:
Show 8 quoted lines
> 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.
Show 5 quoted lines
> 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.gitYou can ignore the reflog.
Show 5 quoted lines
> 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