visual code git提交代码出现冲突解决方案

问题一:
visual code git提交代码出现冲突解决方案

第一步:利用 git pull --rebase origin master重现拉取一下线上的代码

visual code git提交代码出现冲突解决方案

第二步:在代码中解决线上和本地的冲突项,冲突的代码文件会用紫色标识

visual code git提交代码出现冲突解决方案
visual code git提交代码出现冲突解决方案

第三步:git status排查冲突文件

visual code git提交代码出现冲突解决方案

第四步:merge冲突代码

第一种方法:

visual code git提交代码出现冲突解决方案

第二种方法:

git add xxxx(需要解決冲突的文件名)
运行git status 从红色变为绿色

visual code git提交代码出现冲突解决方案
运行git commit -m “add xxxx”
visual code git提交代码出现冲突解决方案

第四步:git add .

visual code git提交代码出现冲突解决方案

第五步:git branch 查询分支

visual code git提交代码出现冲突解决方案

第六步:git rebase --continue

visual code git提交代码出现冲突解决方案
第六步之后在利用git status 查询现在文件状态,现在没有冲突的文件了
visual code git提交代码出现冲突解决方案

第七步:git push -u origin master 可以顺利提交了

visual code git提交代码出现冲突解决方案