etckeeper不会自动将文件签出到/ etc

时间:2016-02-17 18:18:27

标签: linux git debian push git-push

自从我升级到Debian Jessie 8.3并编译GIT 2.6.0之后,很久以来,管理员v1.15并没有自动将文件签出到/等。

重现步骤:

1)在本地创建文件ddd.txt(Windows 7,git版本2.6.3.windows.1),内容为:

root@local-debian8:/etc# 
printf "ddd\n" > ddd.txt

2)用git看

$ git status
On branch local_master
Your branch is up-to-date with 'local/master'.
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        new file:   ddd.txt

3)分阶段

$ git add .

4)看上去是

$ git status
On branch local_master
Your branch is up-to-date with 'local/master'.
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        new file:   ddd.txt

5)提交

$ git commit -m "ddd.txt"
[local_master 347862d] ddd.txt
 1 file changed, 1 insertion(+)
 create mode 100644 ddd.txt

6)将它推送到服务器上的NON-BARE仓库(GIT仓库,由etckeeper创建)

$ git push local HEAD:master
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 262 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
To ssh://root@192.168.1.101/etc
   175d92e..347862d  HEAD -> master

在服务器上,我看到: 7)检查服务器上是否存在文件(已检出?否)

root@local-debian8:/etc# ls /etc/ddd.txt
ls: /etc/ddd.txt No such file or directory

8)看git状态

root@local-debian8:/etc# git status
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        deleted:    ddd.txt

9)看到变化

root@local-debian8:/etc# git show
commit 347862d444f294c491330adc7e967659071d6b5e
Date:   Wed Feb 17 16:14:41 2016 +0100

    ddd.txt

diff --git a/ddd.txt b/ddd.txt
new file mode 100644
index 0000000..1d60b70
--- /dev/null
+++ b/ddd.txt
@@ -0,0 +1 @@
+ddd

10)在服务器上提交

root@local-debian8:/etc# git commit -m "ddd.txt"

知道问题是什么? 它是一个etkeeper错误,来自不兼容的git版本还是错误的配置?

0 个答案:

没有答案