linerleaders.blogg.se

Git rename branch master to main
Git rename branch master to main











git rename branch master to main

Renaming of branch can be done by Git Admins. This blog captures the steps to rename the branch and change the default branch name to new renamed branch. So recently I've renamed one of my repo's default branch from master to main. Note: this will affect other branches, also. To have all your repos branches push to the branch that they pull from, use: git config -local fault upstream. The git branch command does more than just create and delete branches.

#Git rename branch master to main code#

Steps to rename the other users local repoĪs part of adopting the Open Source Inclusive Naming Initiative, it is recommended to change the default branch name from master to main in Source Code Management tools. 18 hours ago &0183 &32 Two options: push all branches to where they get pulled from via fault.

git rename branch master to main

Step 4 Finally delete the master branch from remote.Another great option for your main github branch is 'latest.' The goal is to just be unambiguous.

NOTE: Changing the default branch to 'main' also has the benefit of starting with 'ma' so that autocomplete muscle memory still works. Do not rename the default branch from 'master' to 'main' : r/github r/github 3 yr.

  • Step 3 Swap default branch setting in Github UI remote: To new branch HEAD -> main That was easy.
  • Step 2 Rename the branch master to main in remote.
  • Step 1 Rename master to main in local repo.












  • Git rename branch master to main