Re: moving a remote branch?
- From
- Thomas Anderson <zelnaga@gmail.com>
- Date
- Jun 17, 2010, 13:55 UTC
- Message-ID
- <AANLkTikbOLRc6BvXtO8vznFevj0V_iZr34U1QaHCfFBh@mail.gmail.com>
- In-Reply-To
- <A612847CFE53224C91B23E3A5B48BAC74483CEEA82@xmail3.se.axis.com>
Do I need to switch to the local featurea branch before doing "git push origin origin/featurea:refs/heads/featureb" or can I do that while in the default branch?
On Thu, Jun 17, 2010 at 3:28 AM, Peter Kjellerstedt <peter.kjellerstedt@axis.com> wrote:
Show 44 quoted lines
>> -----Original Message----- >> From: git-owner@vger.kernel.org [mailto:git-owner@vger.kernel.org] On >> Behalf Of Nazri Ramliy >> Sent: den 17 juni 2010 08:20 >> To: Thomas Anderson >> Cc: git@vger.kernel.org >> Subject: Re: moving a remote branch? >> >> On Thu, Jun 17, 2010 at 12:35 PM, Thomas Anderson <zelnaga@gmail.com> >> wrote: >> > git branch -m origin/zelnaga/featurea origin/zelnaga/featureb doesn't >> > seem to be working for me. Instead, I get this error:l >> > >> > error: refname refs/heads/origin/zelnaga/featurea >> > fatal: Branch rename failed >> > >> > Any ideas? >> >> The error message could be improved here. >> >> The reason you get the error is because you were asking git >> to rename a "remote" branch, which it refuses to do because, >> well, it's a remote branch, and for all practical purposes git >> won't allow you to modify any "remote" stuff as they are all >> read-only from our point of view. >> >> If you run "git remote -v" you'll most likely see that "origin" >> is listed in the output which means that your "origin/zelnaga/featurea" >> is a remote branch because its name begin with "origin/". >> >> Hope this helps. >> >> nazri. > > Renaming a remote branch is a two step operation. First you push the > old branch into its new name, and then you remove the old branch. It > can be done with these commands: > > git push origin origin/featurea:refs/heads/featureb > git push origin :featurea > > //Peter > >