我在本地机器上设置了一个 git 存储库,在一个 linode 盒子上设置了一个裸存储库。执行 git push 时没有错误,但我在远程服务器上看不到该文件。我遵循的命令序列如下:
在远程:
abhijat@kangaroo:~$ mkdir dev
abhijat@kangaroo:~$ cd dev && git init --bare
在本地机器上:
krypton:test abhijat$ git init
krypton:test abhijat$ vim app.py
krypton:test abhijat$ git init
Initialized empty Git repository in /Users/abhijat/dev/test/.git/
krypton:test abhijat$ git add .
krypton:test abhijat$ git status
# On branch master
#
# Initial commit
#
# Changes to be committed:
# (use "git rm --cached <file>..." to unstage)
#
# new file: app.py
#
krypton:test abhijat$ git commit -m 'test first commit'
[master (root-commit) 3bee148] test first commit
1 files changed, 16 insertions(+), 0 deletions(-)
create mode 100644 app.py
krypton:test abhijat$ git remote add origin abhijat@linode:~/dev
krypton:test abhijat$ git push -v origin master
Pushing to abhijat@linode:~/dev
Counting objects: 2, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 298 bytes, done.
Total 2 (delta 1), reused 0 (delta 0)
To abhijat@linode:~/dev
01a0e08..2273564 master -> master
但是当我检查 linode 时,该文件不存在:
abhijat@kangaroo:~/dev$ ls -ltr
total 32
drwxr-xr-x 4 abhijat abhijat 4096 Sep 8 10:17 refs
drwxr-xr-x 2 abhijat abhijat 4096 Sep 8 10:17 info
drwxr-xr-x 2 abhijat abhijat 4096 Sep 8 10:17 hooks
-rw-r--r-- 1 abhijat abhijat 73 Sep 8 10:17 description
drwxr-xr-x 2 abhijat abhijat 4096 Sep 8 10:17 branches
-rw-r--r-- 1 abhijat abhijat 23 Sep 8 10:17 HEAD
-rw-r--r-- 1 abhijat abhijat 66 Sep 8 10:57 config
drwxr-xr-x 12 abhijat abhijat 4096 Sep 8 11:03 objects
abhijat@kangaroo:~/dev$ find . -name app.py
abhijat@kangaroo:~/dev$
我在这里遗漏了一些明显的东西吗?通信是通过 ssh 进行的,并且密钥已按预期设置,我无需密码即可登录。但是,该文件不会被复制到远程服务器。
谢谢