# If you want to rename a branch while pointed to any branch, do:
      git branch -m <oldname> <newname>
      
      # If you want to rename the current branch, you can do:
      git branch -m <newname>
      
      # If you want to push the local branch and reset the upstream branch:
      git push origin -u <newname>
      
      # And finally if you want to Delete the remote branch:
      git push origin --delete <oldname>

      Shell language logo
      Renaming Patterns for branches in Git

      Git command hacks

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.