git pull和reset由错误停止“无法创建文件<文件名> (存在文件)“ [英] git pull and reset stopped by error "unable to create file <filename> (File exists)"

查看:265
本文介绍了git pull和reset由错误停止“无法创建文件<文件名> (存在文件)“的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在将我的公司从保险库转移到Git,并且我已经在Github上设置了回购协议,但是由于一些重复发生的错误,本地设置正在令人头疼。最令人困惑的是,当我尝试拉动时,它取消了几个文件的错误错误:无法创建文件(文件存在)。我只想设置自己与遥控器上的东西,所以我尝试做一个混帐重置 - 硬头,它告诉我,它成功了,我的工作目录是干净的。我尝试再次拉动并得到相同的错误!当我运行git gc时,它只是恢复我未分离的更改。

查看Git上的git diff和当前文件系统,发现这些未分离的更改已经在Github上应用。我认为Git试图应用已经应用和失败的更改,但我仍然不明白为什么这不能通过硬重置来解决。试图重置到更远的提交也失败。

我已阅读这个和其他一些文章,但没有任何建议的作品。我不想删除repo并重新克隆,因为我在目录中有一堆被忽略的程序文件需要考虑。谢谢!

解决方案

我发现问题与权限有关。 repo位于Program Files中,我认为Git没有权限在/在该文件夹中执行某些脚本。我更新了此处的问题。


I am currently moving my company to Git from Vault, and I've set up the repos on Github, but setting up locally is being made a headache by some reoccurring errors. The most baffling is that when I try to pull, it cancels with the error "error: unable to create file (File exists)" for a few files. I just want to set myself up with what is on the remote, so I try to do a git reset --hard HEAD, and it tells me that it succeeded and my working directory is clean. I try to pull again and get the same error! When I run git gc, it just restores my unstaged changes.

A look at the git diff and the current file system on Github reveals that these unstaged changes have already been applied on Github. I think Git is trying to apply changes that have already been applied and failing, but I still don't understand why this isn't fixed by a hard reset. Trying to reset to a further back commit also fails.

I have already read this and this and several other articles, but nothing suggested works. I would prefer not to delete the repo and re-clone, because I have a bunch of ignored program files in the directory that need to be accounted for. Thanks!

解决方案

I found the problem is related to permissions. The repo is located in Program Files, and I think Git doesn't have the permissions to execute certain scripts on/in that folder. I have updated the question here.

这篇关于git pull和reset由错误停止“无法创建文件<文件名> (存在文件)“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆