使用sourcetree切换仓库地址及报错git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks fe

一. 使用sourcetree切换仓库地址

1. 点击仓库-仓库设置

2. 修改地址, 从git上复制路径, 保存即可

二. 切换分支时, 报错git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks fetch origin

git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks fetch origin

git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks pull --no-commit origin release/20210107
From https://gitlab.xinghuolive.com/op/xinghuo-business/xinghuo-backend/eduboss
 * branch                  release/20210107 -> FETCH_HEAD

Updating 1aea520d2c..156bdd998a
error: Your local changes to the following files would be overwritten by merge:
    eduboss-main/src/main/java/com/eduboss/service/impl/SmallClassServiceImpl.java
Please commit your changes or stash them before you merge.
Aborting

处理方法: 

1.检查是否本地有修改未提交, 如有

①本地代码先commit, 再执行操作

②本地代码不需要提交, 直接选中对应文件, 丢弃即可

猜你喜欢

转载自blog.csdn.net/bugua3542/article/details/114971715