Tuesday, August 30, 2016

Git push changes in tag to different repository branch


  • The following method will push changes in the tag to different repository branch along with all the commit history details.
  • If you don't have a branch in the new repo to commit updates, go to the git web UI and create a branch. 

  • Now in your old repository, let's assume the tag name is v3.6.0. Change the head to tag
    • git checkout v3.6.0
  • Now add the external git repo URL as a remote reference. Let's name it as support.
    • git remote add support https://github.com/user/project.git
  • Now you can push your tag updates to the branch by using below command.
    • git push support +v3.6.0~0:dev-3.6.0