git/list[1] front-page[2] threads[3] people[4] search[5] about
 

RE: moving a remote branch?

From
Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Date
Jun 17, 2010, 15:05 UTC
Message-ID
<A612847CFE53224C91B23E3A5B48BAC74483CEEB6D@xmail3.se.axis.com>
In-Reply-To
<AANLkTikbOLRc6BvXtO8vznFevj0V_iZr34U1QaHCfFBh@mail.gmail.com>
Show 11 quoted lines
> -----Original Message-----
> From: git-owner@vger.kernel.org [mailto:git-owner@vger.kernel.org] On
> Behalf Of Thomas Anderson
> Sent: den 17 juni 2010 15:56
> To: Peter Kjellerstedt
> Cc: Nazri Ramliy; git@vger.kernel.org
> Subject: Re: moving a remote branch?
> 
> 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?

You do not need to switch branch. The command above has all the information it needs on the command line.

One thing to note though. If you have a local branch tracking the remote featurea branch, it will not automatically start tracking the featureb branch when you rename the remote branch. You will have to fix the tracking manually (either by setting up a new tracking branch for featureb, or by editing the .git/config file to reflect the new situation).

//Peter
Previous: Thomas Anderson
Message 8 of 8 in “moving a remote branch?”
  1. Thomas AndersonJun 17, 2010
  2. Nazri RamliyJun 17, 2010
  3. Peter KjellerstedtJun 17, 2010
  4. Nazri RamliyJun 17, 2010
  5. Peter KjellerstedtJun 17, 2010
  6. Nazri RamliyJun 17, 2010
  7. Thomas AndersonJun 17, 2010
  8. Peter KjellerstedtJun 17, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.