Git Note2:合并分支

Git Note2:合并分支

合并master到main

为了实现本地代码和github上默认main分支关联,步骤如下进行修复 :
# 1. 检查main git checkout -b main #switched to a new branch 'main' git branch # *main # master #2. 将master分支合并 到main上 git merge master #Already up to date # 3.执行,这个会出现一个类似vim,按i输入,esc后输入wq保存 - git pull origin main --allow-unrelated-histories # 4. 合并 - git push origin main