Re: A question about changing remote repo name
- From
- Russell Steicke <russellsteicke@gmail.com>
- Date
- Jan 5, 2010, 02:52 UTC
- Message-ID
- <c1b8b6671001041852w4740b7d6g4b8db1221c5dc744@mail.gmail.com>
- In-Reply-To
- <60ce8d251001032245n4e0267b1o1ecc796f324f8179@mail.gmail.com>
On Mon, Jan 4, 2010 at 2:45 PM, Dongas <dongas86@gmail.com> wrote:
Show 5 quoted lines
> So i need to change the remote name manually. > > I tried modifying the .git/config file locally but it didn't work. > > Could someone help tell how to do it?
After editing .git/config, do this:
$ mv .git/refs/remotes/OLDNAME .git/refs/remotes/NEWNAME
and optionally:
$ mv .git/logs/refs/remotes/OLDNAME .git/logs/refs/remotes/NEWNAME
Remember to rename the remote in any tracking branches in .git/config, as well as the name in the [remote "OLDNAME"] section, and the name in any fetch and push lines. ie
[remote "OLDNAME"] url = something fetch = +refs/heads/*:refs/remotes/OLDNAME/* [branch "master"] remote = OLDNAME merge = refs/heads/master
Becomes
[remote "NEWNAME"] url = something fetch = +refs/heads/*:refs/remotes/NEWNAME/* [branch "master"] remote = NEWNAME merge = refs/heads/master
-- Virus found in this message.