当我在OS X上克隆
Linux源代码时,它们会立即被更改,并且git reset –hard不会将内容恢复.这是一个完整的会议:
$git clone git://github.com/torvalds/linux.git
$cd linux
$git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git checkout -- ..." to discard changes in working directory)
modified: include/uapi/linux/netfilter/xt_CONNMARK.h
modified: include/uapi/linux/netfilter/xt_DSCP.h
modified: include/uapi/linux/netfilter/xt_MARK.h
modified: include/uapi/linux/netfilter/xt_RATEEST.h
modified: include/uapi/linux/netfilter/xt_TCPMSS.h
modified: include/uapi/linux/netfilter_ipv4/ipt_ECN.h
modified: include/uapi/linux/netfilter_ipv4/ipt_TTL.h
modified: include/uapi/linux/netfilter_ipv6/ip6t_HL.h
modified: net/netfilter/xt_DSCP.c
modified: net/netfilter/xt_HL.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")
我们可以看到,克隆后文件立即发生了变化.甚至不是他们的元数据,而是内容:
git diff include/uapi/linux/netfilter_ipv6/ip6t_HL.h
index ebd8ead..6e76dbc 100644
--- a/include/uapi/linux/netfilter_ipv6/ip6t_HL.h
+++ b/include/uapi/linux/netfilter_ipv6/ip6t_HL.h
@@ -1,6 +1,6 @@
-/* Hop Limit modification module for ip6tables
+/* ip6tables module for matching the Hop Limit value
* Maciej Soltysiak
- * Based on HW's TTL module */
+ * Based on HW's ttl module */
#ifndef _IP6T_HL_H
#define _IP6T_HL_H
@@ -8,14 +8,14 @@
#include
enum {
- IP6T_HL_SET = 0,- IP6T_HL_INC,- IP6T_HL_DEC
+ IP6T_HL_EQ = 0,/* equals */
+ IP6T_HL_NE,/* not equals */
+ IP6T_HL_LT,/* less than */
+ IP6T_HL_GT,/* greater than */
};
-#define IP6T_HL_MAXMODE IP6T_HL_DEC
-struct ip6t_HL_info {
+struct ip6t_hl_info {
__u8 mode;
__u8 hop_limit;
};
系统信息:
>文件系统:Journaled HFS
>操作系统:OS X 10.11.5(15F34)
> git版本:2.9.0
>〜/ .gitconfig只有[user]条目.
到底是怎么回事?为什么在克隆后立即修改文件?