From: Thomas Anderson <zelnaga@gmail.com>
To: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Cc: Nazri Ramliy <ayiehere@gmail.com>,
"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: moving a remote branch?
Date: Thu, 17 Jun 2010 08:55:38 -0500 [thread overview]
Message-ID: <AANLkTikbOLRc6BvXtO8vznFevj0V_iZr34U1QaHCfFBh@mail.gmail.com> (raw)
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:
>> -----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
>
>
next prev parent reply other threads:[~2010-06-17 13:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-17 4:35 moving a remote branch? Thomas Anderson
2010-06-17 6:19 ` Nazri Ramliy
2010-06-17 8:28 ` Peter Kjellerstedt
2010-06-17 12:13 ` Nazri Ramliy
2010-06-17 13:02 ` Peter Kjellerstedt
2010-06-17 13:19 ` Nazri Ramliy
2010-06-17 13:55 ` Thomas Anderson [this message]
2010-06-17 15:05 ` Peter Kjellerstedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTikbOLRc6BvXtO8vznFevj0V_iZr34U1QaHCfFBh@mail.gmail.com \
--to=zelnaga@gmail.com \
--cc=ayiehere@gmail.com \
--cc=git@vger.kernel.org \
--cc=peter.kjellerstedt@axis.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).