2

我在我的 VPS 上创建了一个裸仓库

repo 的文件夹是 "~/repo" ,我在 "~/rpeo/.git" 处使用了 "git init --bare" 然后什么也没做

然后我克隆了它并推送了一些东西,我得到了这个结果:

 $ git push origin master
Counting objects: 19, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (14/14), done.
Writing objects: 100% (19/19), 797.99 KiB, done.
Total 19 (delta 1), reused 0 (delta 0)
To ssh://XXXX@XXXX.com:3344/~/ROOT
 * [new branch]      master -> master

我还可以在服务器端查看日志并使用“git pull”来获取这些文件

日志:

commit 833ad06648f999f51d54c9e082a136270cbd3686
  Author: XXXX <XXXX@gmail.com>
  Date:   Mon Mar 10 14:45:49 2014 +0800

    init web

但是 ~/repo 仍然是空的

请帮助我,非常感谢你!

4

1 回答 1

1

~/repo is still empty

What do you mean by this? If you mean there is no source code inside it, then yes, a bare repository will not contain working copies of your source files.

The repo's file folder is "~/repo" , I used "git init --bare" at "~/repo/.git" and then did nothing

If you did this, then strictly, ~/repo is not the bare repository but ~/repo/.git. By convention, bare repository directories end in .git, so you'd better do

git init --bare ~/repo.git

instead, then ~/repo.git is your bare repository.

于 2014-03-10T07:03:12.690 回答