Move a branch to a new tag

My personal WordPress install is cloned from the wordpress git mirror on GitHub. I checked out the 2.7.1 tag to the branch “stable” (git checkout -b stable 2.7.1) and its been running fine since. Now WordPress 2.8 has been released I want to move my stable branch to the 2.8 tag.

I tried the following (all on the stable branch) but get conflicts as it tries to apply each each commit, something doesn’t seem right. I have made no local changes/commits on the stable branch.

  • Pushing updates to a pruned Mercurial branch
  • Make an existing Git branch track a remote branch?
  • Git post-receive hook should not send email by new branching push
  • restore deleted git branch you don't know the name of
  • Switching current work in master branch to a new branch (in git)
  • Accessing a repo in Netbeans with git
  • git fetch 
    git fetch --tags
    git rebase 2.8
    First, rewinding head to replay your work on top of it...
    Applying: Prepare the branch for the inevitable.
    error: patch failed: wp-includes/version.php:8
    error: wp-includes/version.php: patch does not apply
    Using index info to reconstruct a base tree...
    Falling back to patching base and 3-way merge...
    Auto-merging wp-includes/version.php
    CONFLICT (content): Merge conflict in wp-includes/version.php
    Failed to merge in the changes.
    Patch failed at 0001 Prepare the branch for the inevitable.
    When you have resolved this problem run "git rebase --continue".
    If you would prefer to skip this patch, instead run "git rebase --skip".
    To restore the original branch and stop rebasing run "git rebase --abort".

    How do I “move” my stable branch to the 2.8 tag?

  • How to keep two git repos synchronized?
  • Git Configuration with eclipse--not able to push code from eclipse to remote git server
  • gitlab 6.0 Lost Project After Upgrade
  • What is the difference between Branch and Remote in GIT?
  • GIT clone to external drive for backup
  • What is the different between force push and normal push in git
  • 2 Solutions collect form web for “Move a branch to a new tag”

    Use “git checkout 2.8”.

    If you want to move “stable”, you can simply remove/recreate it:

    $ git checkout 2.8
    $ git branch -d stable
    $ git checkout -b stable
    # git checkout stable
    # git reset --hard 2.8

    There you go.

    Git Baby is a git and github fan, let's start git clone.