git pull拉取文件时有冲突 Please commit your changes or stash them before you merge.

在git stash命令前最好是没有 git add  git commit 这两步,有也可以继续执行。

git stash 

 

git stash pop 恢复最新的进度到工作区。git默认会把工作区和暂存区的改动都恢复到工作区。
git pull
# 再次拉取

 git stash 的作用

git stash用于想要保存当前的修改,但是想回到之前最后一次提交的干净的工作仓库时进行的操作.git stash将所有未提交的修改(工作区和暂存区)保存至堆栈中,用于后续恢复当前工作目录。

猜你喜欢

转载自blog.csdn.net/wsy_miao/article/details/106267713