2

I created a bare repo on my VPS

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

Then I cloned it and pushed something I got this result :

 $ 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

I can also see the log on the server side and use "git pull" to get these files

the log :

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

    init web

but ~/repo is still empty

Please help me , thank u very much!

xdazz
  • 158,678
  • 38
  • 247
  • 274
ElvisKang
  • 77
  • 5

1 Answers1

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.

xdazz
  • 158,678
  • 38
  • 247
  • 274
  • thank for ur help,I'm a newbie. I create the /.git because "git init --bare" will generate some files without a folder,so I thought I can create a folder for them ,which is similar with "git init"."empty" means I can't find the files that I pushed in "~/repo" – ElvisKang Mar 10 '14 at 08:01
  • There are some articles recommend that use "git init --bare" instead of "git init".So I try to do that.Can I use bare repo and push files to ~/repo and put the files that "git init --bare" generated into a different folder? – ElvisKang Mar 10 '14 at 08:07
  • I read some documents , and I know where I went wrong, thank u – ElvisKang Mar 10 '14 at 08:35