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

Re: moving a remote branch?

From
Nazri Ramliy <ayiehere@gmail.com>
Date
Jun 17, 2010, 12:13 UTC
Message-ID
<AANLkTikeLpvGA-RFBdMGblOnhNKJ6dUrpUZQlENMP51A@mail.gmail.com>
In-Reply-To
<A612847CFE53224C91B23E3A5B48BAC74483CEEA82@xmail3.se.axis.com>

On Thu, Jun 17, 2010 at 4:28 PM, Peter Kjellerstedt > Renaming a remote branch is a two step operation. First you push the

Show 5 quoted lines
> 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.

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

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
Previous: Peter KjellerstedtNext: Peter Kjellerstedt
Message 4 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.