git出现 You are in the middle of a merge -- cannot amend问题解决方法

在平时的提交代码的过程中这个问题比较常见,解决方法如下:

git reset --merge

注:取消合并

git rebase

注:将当前分支重新设置基线

git diff -w 冲突的文件

注:查看冲突点,修改冲突的文件,达到提交的状态。

git rebase --continue

注:让rebase继续处理

git add

注:追加修改后的文件

git rebase --continue

注:让rebase继续处理,查看是否有其他文件未提交

git commit -m 'desc sth' --amend

注:提交修改后的代码

git push branchName

注:提交到某个分支中
 

你可能感兴趣的:(Git)