Git已经是最新的,除非我重置 [英] Git already up to date unless I reset

查看:103
本文介绍了Git已经是最新的,除非我重置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用于生活网站的克隆回购,并且我从裸仓回购了。由于某种原因,每次执行git pull时,我都会收到已经更新的消息。但它不是最新的,也没有更新。如果我做了一个git reset --hard HEAD ^,然后git pull再次发生变化。

这里有什么问题,我该如何修复它,以便git拉将拉和合并更改,而不需要硬重置?

解决方案

如果正在工作一个SHA1提交参考,例如。


I have a cloned repo I use for the live site and I have it pull from a bare repo. For some reason every time I execute "git pull" I get the already up to date message. But it's not up to date and not updated. If I do a git reset --hard HEAD^ and then git pull again, the changes come in.

What's the problem here and how do I fix it so that git pull will pull and merge changes in without needing a hard reset?

解决方案

That would be the case if are working on a DETACHED HEAD (see this SO question for more)

That happens when you checkout directly a SHA1 commit reference, for instance.

这篇关于Git已经是最新的,除非我重置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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