免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 36600 | 回复: 12

git pul已经提示Already up-to-date,为何git status却仍有文件与kernel git不一致? [复制链接]

论坛徽章:
0
发表于 2011-07-23 18:48 |显示全部楼层
本帖最后由 lofeng410 于 2011-07-23 23:15 编辑

为什么会出现这种情况呢?
本来发现文件被修改,所以想将被修改的文件删除,然后重新从库上取最新的下来,但是出现这种状况,这个是为何呢?给如何解决呢?
git.png



之前用的是这个库git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.32.y.git
今天开始clone这两个库,但是速度太慢了,只有50k左右,想稍微将速度提高点,感觉可能是服务器端做了限制,不知兄弟们那得速度如何?


git clone git://git.kernel.org/pub/scm/linux/kernel/git/longterm/linux-2.6.34.y.git/
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-3.0.y.git/

这是我git clone的两个库,兄弟们一般都clone哪个git库的呢?

论坛徽章:
0
发表于 2011-07-23 19:53 |显示全部楼层
50K显然很不现实啊

论坛徽章:
0
发表于 2011-07-23 23:18 |显示全部楼层
git pull不会覆盖你本地的修改

论坛徽章:
0
发表于 2011-07-24 14:59 |显示全部楼层
你修改以后没有commit。这时候你想恢复的话。
git checkout include/
git checkout Documentation/

git status看看修改过哪些目录。想恢复哪个就checkout哪个


另外如果你的修改commit了,先把commit reset掉,再checkout即可。

修改时建议你还是自己建一个branch.改自己的branch,然后pull 了master以后,直接从master上rebase到自己的branch上,自己修改的也不会没有。但是如果冲突了那就不行了。

论坛徽章:
0
发表于 2011-07-24 15:30 |显示全部楼层

论坛徽章:
2
2015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:53:17
发表于 2011-07-24 16:10 |显示全部楼层
哥告诉你一绝招: git reset --hard HEAD

论坛徽章:
0
发表于 2011-07-25 00:21 |显示全部楼层
回复 6# 帅绝人寰


    好像还是不行,如下:
Root@ROOT-PC /d/kernel_git/linux-2.6.32.y (master)
$ git reset --hard HEAD
HEAD is now at 376faec Linux 2.6.32.28

Root@ROOT-PC /d/kernel_git/linux-2.6.32.y (master)
$ git status
# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   Documentation/IO-mapping.txt
#       modified:   include/linux/netfilter/xt_connmark.h
#       modified:   include/linux/netfilter/xt_dscp.h
#       modified:   include/linux/netfilter/xt_mark.h
#       modified:   include/linux/netfilter/xt_rateest.h
#       modified:   include/linux/netfilter/xt_tcpmss.h
#       modified:   include/linux/netfilter_ipv4/ipt_ecn.h
#       modified:   include/linux/netfilter_ipv4/ipt_ttl.h
#       modified:   include/linux/netfilter_ipv6/ip6t_hl.h
#       modified:   net/ipv4/netfilter/ipt_ecn.c
#       modified:   net/netfilter/xt_connmark.c
#       modified:   net/netfilter/xt_dscp.c
#       modified:   net/netfilter/xt_hl.c
#       modified:   net/netfilter/xt_mark.c
#       modified:   net/netfilter/xt_rateest.c
#       modified:   net/netfilter/xt_tcpmss.c
#
no changes added to commit (use "git add" and/or "git commit -a")

Root@ROOT-PC /d/kernel_git/linux-2.6.32.y (master)
$ git pull
Already up-to-date.

Root@ROOT-PC /d/kernel_git/linux-2.6.32.y (master)
$

论坛徽章:
5
摩羯座
日期:2014-07-22 09:03:552015元宵节徽章
日期:2015-03-06 15:50:392015亚冠之大阪钢巴
日期:2015-06-12 16:01:352015年中国系统架构师大会
日期:2015-06-29 16:11:2815-16赛季CBA联赛之四川
日期:2018-12-17 14:10:21
发表于 2011-07-25 10:36 |显示全部楼层
本帖最后由 T-Bagwell 于 2011-07-25 10:38 编辑

照着我的操作进行操作就可以了

  1. [root@btg ext4]# git status

  2. # On branch master
  3. # Changed but not updated:
  4. #   (use "git add <file>..." to update what will be committed)
  5. #   (use "git checkout -- <file>..." to discard changes in working directory)
  6. #
  7. #        modified:   fs/ext4/acl.h
  8. #
  9. # Untracked files:
  10. [root@btg ext4]# git commit -am "fuck"
  11. [master 4786fcc] fuck
  12. 1 files changed, 0 insertions(+), 3 deletions(-)
  13. [root@btg ext4]# git status
  14. # On branch master
  15. # Your branch is ahead of 'origin/master' by 1 commit.
  16. #
  17. [root@btg ext4]# git format-patch -s -1
  18. 0001-fuck.patch
  19. [root@btg ext4]# git log|grep commit|head -n2|tail -n1|awk -F " " '{ print $2 }'|xargs git reset --hard
  20. HEAD is now at 275d3ba ext4: remove loop around bio_alloc()
  21. [root@btg ext4]# git status
  22. # On branch master

复制代码
照着我的操作操作就可以了

论坛徽章:
0
发表于 2011-07-25 18:02 |显示全部楼层
楼主应该是在一个文件名大小写不敏感的分区,因为那个目录下面有好多文件都是重名的,只是大小写不同。
换成区分大小写的分区格式就好啦

论坛徽章:
0
发表于 2011-07-27 00:14 |显示全部楼层
回复 9# anbutu

可能是这个原因,我目前是在NTFS文件系统上clone的内核git库。
这样说来在Windows下是没有办法解决这个问题了,真是悲剧
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP