{"thread":{"id":"13866","subject":"[BUG] git-branch -m cannot rename remote branches","startedAt":"2008-06-08T20:57:19Z","lastAt":"2008-06-09T12:53:29Z","messageCount":4,"participants":["Jakub Narebski","Johannes Schindelin","Olivier Marin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"79159","messageId":"200806082257.20833.jnareb@gmail.com","threadId":"13866","inReplyTo":null,"subject":"[BUG] git-branch -m cannot rename remote branches","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-06-08T20:57:19Z","receivedAt":"2008-06-08T20:57:19Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"I cannot rename remote branch (possibly packed, and possibly with\nreflog) using \"git branch\"\n\n[gitweb/web@git]$ git branch -m refs/remotes/gitweb-caching/master \\\n                                refs/remotes/gitweb-kernel.org/master\nerror: refname refs/heads/refs/remotes/gitweb-caching/master not found\nfatal: Branch rename failed\n[gitweb/web@git]$ git branch -m gitweb-caching/master \\\n                                gitweb-kernel.org/master\nerror: refname refs/heads/gitweb-caching/master not found\nfatal: Branch rename failed\n[gitweb/web@git]$ git branch -m remotes/gitweb-caching/master \\\n                                remotes/gitweb-kernel.org/master\nerror: refname refs/heads/remotes/gitweb-caching/master not found\nfatal: Branch rename failed\n\n-- \nJakub Narebski\nPoland\n"},{"id":"79179","messageId":"alpine.DEB.1.00.0806082357470.1783@racer","threadId":"13866","inReplyTo":"200806082257.20833.jnareb@gmail.com","subject":"Re: [BUG] git-branch -m cannot rename remote branches","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-06-08T22:58:38Z","receivedAt":"2008-06-08T22:58:38Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 8 Jun 2008, Jakub Narebski wrote:\n\n> I cannot rename remote branch (possibly packed, and possibly with\n> reflog) using \"git branch\"\n\nThat is very much by design; a next fetch would get them with their \ncurrent name anyway.  A \"remote prune\" should get rid of any stale \nbranches.\n\nSo yes, \"branch -m\" with remote branches does not make sense.\n\nCiao,\nDscho\n"},{"id":"79205","messageId":"200806090906.51937.jnareb@gmail.com","threadId":"13866","inReplyTo":"alpine.DEB.1.00.0806082357470.1783@racer","subject":"Re: [BUG] git-branch -m cannot rename remote branches","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-06-09T07:06:50Z","receivedAt":"2008-06-09T07:06:50Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Mon, 9 Jun 2008, Johannes Schindelin wrote:\n> On Sun, 8 Jun 2008, Jakub Narebski wrote:\n> \n> > I cannot rename remote branch (possibly packed, and possibly with\n> > reflog) using \"git branch\"\n> \n> That is very much by design; a next fetch would get them with their \n> current name anyway.  A \"remote prune\" should get rid of any stale \n> branches.\n> \n> So yes, \"branch -m\" with remote branches does not make sense.\n\nWhat I really wanted was \"git remote rename <old-name> <new-name>\",\ntogether with renaming branches and moving reflogs.  I can do first\npart by editing config file (\"git remote rename\"/\"git remote mv\"\nprobably would want to assume that user wants to move branches if\nthey follow remotes/<old-name>/* calling convention; ask user if it\nis not the case?).  I thought that I could use \"git branch -m\" for\nthe other... I was left with editing packed-refs file (BTW. is leaving\nempty directory 'xx' when packing 'xx/name' branch by design?) and\nmoving reflog by hand.\n\n-- \nJakub Narebski\nPoland\n"},{"id":"79221","messageId":"484D27C9.4000102@free.fr","threadId":"13866","inReplyTo":"200806090906.51937.jnareb@gmail.com","subject":"Re: [BUG] git-branch -m cannot rename remote branches","fromName":"Olivier Marin","fromEmail":"dkr+ml.git@free.fr","sentAt":"2008-06-09T12:53:29Z","receivedAt":"2008-06-09T12:53:29Z","isPatch":false,"sender":{"key":"dkr+ml.git@free.fr","avatar":null},"body":"Jakub Narebski a écrit :\n> \n> What I really wanted was \"git remote rename <old-name> <new-name>\",\n> together with renaming branches and moving reflogs.  I can do first\n> part by editing config file (\"git remote rename\"/\"git remote mv\"\n> probably would want to assume that user wants to move branches if\n> they follow remotes/<old-name>/* calling convention; ask user if it\n> is not the case?).  I thought that I could use \"git branch -m\" for\n> the other... I was left with editing packed-refs file (BTW. is leaving\n> empty directory 'xx' when packing 'xx/name' branch by design?) and\n> moving reflog by hand.\n> \n\nYou can use \"git update-ref\" for that. Maybe something like that:\n\n$ git update-ref <newref> <oldref>\n$ git update-ref -d <oldref> <newref>\n\nOlivier.\n"}]}