I am trying to transfer a local git repository to a web server. I followed the approach here: Git: move existing repository from PC to server, clone from server
First I initialized an empty repository on my local machine, and added two files and did a commit.
Then on the server I created a folder /www/git
, and changed to that directory and did
git init --shared --bare
Then on the local machine I run
git remote add server user@server.com:/www/git
Then I did
git push server master
which gave output like:
Counting objects: 4, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 2.13 KiB, done.
Total 4 (delta 0), reused 0 (delta 0)
To user@server.com:/www/git
* [new branch] master -> master
However on the server, I cannot see any of the two files I added on local machine.
If I do ls
in /www/git
I get:
HEAD branches config description hooks info objects refs
but none of these are none of these files and directories are the one I pushed from my local machine.