情况说明:想要拉取最新代码,自己在本地修改过的代码。需要达到的情况:拉取最新的代码,但是本地的自己的修改也能保存
小乌龟报错情况:
git.exe pull --progress -v --no-rebase "origin"
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 2), reused 0 (delta 0), pack-reused 0
From github.com:jingjing616/hello_tortise
4712b71..5c7d2f1 qq_branch -> origin/qq_branch
= [up to date] main -> origin/main
= [up to date] merge_test -> origin/merge_test
error: Your local changes to the following files would be overwritten by merge:
test.py
Please commit your changes or stash them before you merge.
Aborting
git 未能顺利结束 (退出码 128) (4703 ms @ 2022/5/29 22:31:45)
解决方式:git bash命令行
git stash
git pull origin master(这个要填写自己需要拉取的分支)
git stash pop
小乌龟处理方式如下:(流程和gitbash是一样的,先贮藏自己的修改,然后再拉取最新代码,然后再弹出贮藏)
最后在本地弹出贮藏,同样右键即可看到弹出贮藏的选项