Answers for "git go to main branch"

0

how to move master branch to main branch

# 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
Posted by: Guest on December-25-2020
1

how to switch to a master which is already added

git checkout master
Posted by: Guest on August-19-2020
0

switching git branch in gitbash

Switch over to the branch "issue1" when you want to add new commits to it.

Use the checkout command to switch branch.

$ git checkout <branch>
Posted by: Guest on November-15-2020

Code answers related to "git go to main branch"

Browse Popular Code Answers by Language