RE: moving a remote branch?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: git-owner@xxxxxxxxxxxxxxx [mailto:git-owner@xxxxxxxxxxxxxxx] On
> Behalf Of Nazri Ramliy
> Sent: den 17 juni 2010 14:13
> To: Peter Kjellerstedt
> Cc: Thomas Anderson; git@xxxxxxxxxxxxxxx
> Subject: Re: moving a remote branch?
> 
> On Thu, Jun 17, 2010 at 4:28 PM, Peter Kjellerstedt 
> > 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
> 
> I'd like to add (more confusion!:) with this clarification:
> 
> The two push operation above rename the branch on the remote side.
> It does not affect any of your local branches.

No, it does not affect any local branches, but it _does_ effect 
the representation of the remote branches in the local repository.

> If you do "git branch -a" then you'd still see the
> "origin/zelnaga/featurea" branch.

No, you will not (at least not with git 1.7.1 that I use). 

Neither do you need to do the two steps below as the two pushes 
above are enough to also keep the status of the remote branches 
in sync in the local repository..

> Doing a "git fetch origin" will get the newly renamed branch from the
> remote repo and create a local version of it on your local repo.
> 
> At this point you can do "git branch -D origin/featurea".
> 
> nazri

//Peter

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]