当前分支branch1,需要切到master去pull最新的代码:
git stash
保存当前修改git checkout master
切到mastergit pull
获取最新代码git checkout branch1
切回mastergit pull
获取最新代码 (可省略)git stash apply
恢复修改
也可以使用git stash pop
,会删除当前stash idgit merge master
和master合并解决冲突
git stash list
可以查看stash列表
参考:https://blog.csdn.net/weixin_37490221/article/details/82988656
https://www.cnblogs.com/juandx/p/5362723.html