git 报错
在linux系统进行开发创建了一个 名称为 \ 的文件
然后在windows系统上拉代码切换分支的时候报错
DESKTOP-TJTAEN4+admin@DESKTOP-TJTAEN4 MINGW64 /e/djc/djc_wcapp (master)
$ git checkout dev
error: Updating the following directories would lose untracked files in them:
app/\
Aborting
c 处理方式 先删除文件
rm '\'
然后提交代码
报错信息
[root@djc_nb djc_wcapp]# git add . warning: You ran 'git add' with neither '-A (--all)' or '--ignore-removal', whose behaviour will change in Git 2.0 with respect to paths you removed. Paths like 'app/\' that are removed from your working tree are ignored with this version of Git. * 'git add --ignore-removal <pathspec>', which is the current default, ignores paths you removed from your working tree. * 'git add --all <pathspec>' will let you also record the removals. Run 'git status' to check the paths you removed from your working tree.
原因是因为有删除的文件,没有跟新到本地的仓库而导致的。
解决办法: 使用 git add -A 或者 git add -all
浙公网安备 33010602011771号