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

Renaming a repo

From
HWHilco Wijbenga <hilco.wijbenga@gmail.com>
Date
Apr 19, 2011, 18:02 UTC
Message-ID
<BANLkTiknSbWrskhGLWUBEq1=9KV4hC3ttA@mail.gmail.com>
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

Next: Tomas Carnecky
Message 1 of 3 in “Renaming a repo”
  1. Hilco WijbengaApr 19, 2011
  2. Tomas CarneckyApr 19, 2011
  3. Hilco WijbengaApr 19, 2011

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.