是什么导致这个git警告?

时间:2011-11-29 23:10:03

标签: git git-push

最近每当我进行git推送时,我都会得到这样的交换:

owner-pc ~/dev/project $ git push
Counting objects: 15, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (8/8), done.
Writing objects: 100% (8/8), 3.15 KiB, done.
Total 8 (delta 6), reused 0 (delta 0)
remote: Pulling changes into edge...
remote: From /var/git/project
remote:  * branch            master     -> FETCH_HEAD
remote: error: Your local changes to 'config/development.php' would be overwritten by merge.  Aborting.
remote: Please, commit your changes or stash them before you can merge.
remote: Updating 1984db9..d584535
remote: Changes have been pulled and applied to edge.
To ssh://dev.trueaction.com/var/git/project
   a3a085e..8ec5b07  styleguide -> styleguide

...但推动显然完成没有错误,一切正常。 config/development.php没有本地更改,也没有一段时间的更改。我没有在提交时收到任何错误或警告,只有在推送时,而不是拉动。

导致错误的原因是什么? (它的行为类似于警告,但表示它是错误,因此我将使用该术语。)

2 个答案:

答案 0 :(得分:1)

根据您的输出判断 - 您正在推送非裸机库,并且有人编辑了遥控器上的config / development.php。这就是产生你所看到的交流的原因。

答案 1 :(得分:1)

“错误”发生在post(-receive)钩子中(由remote:前缀证明),其中钩子将你推送到其他仓库中的代码拉出来,并且repo有一些局部修改导致错误。

由于post-receive钩子不影响推送的结果(因为它们发生在推送之后),推送本身已经很好,但是钩子尝试作为后接收的一部分的拉力已经失败,因为当地的变化。

查找拉动发生的位置(在/ var / git / project / hooks /中找到一个post-receive或其他一些活动的钩子,看看它在做什么)并删除那里的局部修改。

相关问题