1

环境:

  • Ubuntu 12.04
  • Windows 7的

我将 Android 金鱼内核 repo 的 .git 目录从 Ubuntu 复制到 Windows,结果git status是:

# On branch android-goldfish-2.6.29
# 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:   arch/ia64/scripts/check-gas
#       modified:   arch/ia64/scripts/toolchain-flags
#       modified:   arch/powerpc/boot/wrapper
#       modified:   drivers/mmc/core/sdio_io.c
#       modified:   include/linux/earlysuspend.h
#       modified:   include/linux/mmc/sdio_func.h
#       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_connmark.h
#       modified:   include/linux/netfilter_ipv4/ipt_dscp.h
#       modified:   include/linux/netfilter_ipv4/ipt_ecn.h
#       modified:   include/linux/netfilter_ipv4/ipt_mark.h
#       modified:   include/linux/netfilter_ipv4/ipt_tcpmss.h
#       modified:   include/linux/netfilter_ipv4/ipt_tos.h
#       modified:   include/linux/netfilter_ipv4/ipt_ttl.h
#       modified:   include/linux/netfilter_ipv6/ip6t_hl.h
#       modified:   include/linux/netfilter_ipv6/ip6t_mark.h
#       modified:   include/linux/wakelock.h
#       modified:   net/ipv4/netfilter/ipt_ecn.c
#       modified:   net/ipv4/netfilter/ipt_ttl.c

但是我没有修改任何字段,并且git checkout -- .不起作用,它仍然提示信息。所以有什么问题?

谢谢!

4

2 回答 2

2

无需复制粘贴 .git 文件夹。在要复制代码的 ubuntu 或 windows 中再次设置 git。添加远程源并首先提取您的代码。如果您没有远程来源,则首先将您的代码推送到一些远程仓库中,例如 github 或 bitbucket。我也在我的项目中做到了。

于 2013-08-24T11:05:49.707 回答
0

修改必须在行尾,windows 和 linux 不同。

当你使用GitExtensions时,这个过程是自动的。但提交此更改不应影响您的项目。

您最终可以在github 文档上阅读有关它的更多信息 ,您可以使用公开的解决方案,该解决方案是SO中的响应

于 2013-08-26T18:12:31.997 回答