Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

git change master to main

# Step 1 
# create main branch locally, taking the history from master
git branch -m master main
# Step 2 
# push the new local main branch to the remote repo (GitHub) 
git push -u origin main
# Step 3
# switch the current HEAD to the main branch
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main
# Step 4
# change the default branch on GitHub to main
# https://docs.github.com/en/github/administering-a-repository/setting-the-default-branch
# Step 5
# delete the master branch on the remote
git push origin --delete master
Comment

Git change branch from branch to main

git checkout master        # to be sure you are on master branch
git push origin HEAD:main  # and then push the current branch (as master) to main
Comment

change master to main git

$ git branch -m master main
Comment

PREVIOUS NEXT
Code Example
Shell :: loop over file bash 
Shell :: update wsl 
Shell :: how to edit bashrc 
Shell :: how to commit single file in git 
Shell :: Cargo, the Rust package manager, is not installed or is not on PATH. 
Shell :: git tag to previous commit 
Shell :: cmake run cmake clean 
Shell :: clean local branches git 
Shell :: change user linuxcommand ch 
Shell :: linux remove folder with content 
Shell :: start kafka locally 
Shell :: how to connect to heroku app using git remotely 
Shell :: how to remove all files from staging area git 
Shell :: grep not 
Shell :: set date and time linux 
Shell :: git push submodules all 
Shell :: install virtualbox extension pack from command line 
Shell :: how to delete branch github 
Shell :: how to update forked repo in github 
Shell :: delete git branch from remote 
Shell :: how to run spigot server using bat 
Shell :: rails aborted! TypeError: superclass mismatch for class Command 
Shell :: how to check if helm is installed 
Shell :: git get develop to feature branche 
Shell :: increment in bash 
Shell :: apache license 
Shell :: make pip3 pip 
Shell :: ubuntu install brave 
Shell :: ionic cordova generate component 
Shell :: docker desktop kubernetes dashboard 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =