git合并分支并推送
背景:需要合并开发分支develop到自己的分支Fnb,并更新推送到代码仓库
# 要将分支develop合并进入 Fnb分支
# 切换到目标分支
git checkout Fnb
# 拉取远程分支最新代码
git pull
git fetch
# 合并develop分支到当前分支
git merge develop
# 处理冲突(若有)
# 编辑冲突文件( 代码编译看到报错的地方) → 保存后执行:
git add 冲突文件路径
git commit -m "Merge develop into Fnb"
# 推送合并结果到远程
git push origin Fnb