Answers for "how to set default branch in git"

3

git create new default branch

git branch -m master main # renames "master" to "main"
git push -u origin main # push new branch
Posted by: Guest on May-13-2021
2

change git default branch

git config --global init.defaultBranch <defaultBranchName>
Posted by: Guest on April-15-2021
11

change default branch github

On GitHub, navigate to the main page of the repository.
Under your repository name, click Settings.
In the left menu, click Branches.
Under "Default branch", to the right of the default branch name, click .
Use the drop-down, then click a branch name.
Click Update.
Posted by: Guest on December-30-2020
0

Change default branch on git

git branch -m deploy prod
git fetch origin
git branch -u origin/prod prod
git remote set-head origin -a
Posted by: Guest on April-26-2021

Code answers related to "how to set default branch in git"

Browse Popular Code Answers by Language