Git pull导致“需要更新”和显示为已修改的文件 [英] Git pull results in "needs update" and files shown as modified

查看:514
本文介绍了Git pull导致“需要更新”和显示为已修改的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在进行清理生产类型的回购时,所有更改集都会遇到,并导致文件出现修改并需要提交。 git log未显示应该导致这些更改的提交 ...更改只是在没有日志记录的情况下提取,因此它认为它不同步。



拉的结果显示每个文件的需要更新消息

解决方案



当我一直在测试我的解决方案时,我不得不利用......

/ p>

git reset --hard 这会将您移回日志中最近的提交。



git clean -fd 它会从日志中最近的提交以来杀死未跟踪文件。



最终,我决定需要将违规设置文件更改为 chmod 777 ,并且提交权限更改。另一个选择是将Git更改为权限不可知模式,并使用 git config core.filemode false 在此处阅读更多信息:如何让Git忽略文件模式(chmod)更改?
$ b $然后,我做了一次合并更改,并将日志更新与文件一起更新,将违规文件的许可权重新更改为644,并将其提交给...并将其推回给工作的主人(很高兴这是)



似乎这是一个错误,它有权限失败,允许合并文件变更集,但日志历史记录不反映提交信息!!!



BTW:我的 git --version git version 1.5.6.5


Upon pull (into a clean production-type repo) all the changesets come across and cause the files to appear modified and needing a commit. The git log does not show the commits that should have caused these changes... the changes just pull without the log notes so it believes it's out of sync.

The result of the pull shows "needs update" messages for each file.

解决方案

How I got out of the mess:

As I kept pulling to test my solutions I had to make use of...

git reset --hard which moves you back to the most recent commit in the log.

git clean -fd which kills off the untracked files since the more recent commit in the log.

Eventually I decided I needed to change the offending settings file to chmod 777 and commit the permission change. Another option would have been to change Git into permission agnostic mode with git config core.filemode false Read more here: How do I make Git ignore file mode (chmod) changes?

Then I did a pull to merge the changes and have the log update along with the files, changed the permission of the offending file back to 644 and commit that... and pushed it back to the working master (glad that's allowed.)

Seems like this is a bug that having a permission failure allows the file changesets to be merged but the log history doesn't reflect the commits!!!

BTW: My git --version is git version 1.5.6.5

这篇关于Git pull导致“需要更新”和显示为已修改的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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