I am following the examples here http://wiki.dreamhost.com/Git
Basically I want to create a git repo i can push to on a server from my desktop... On host:
[host ~]$ mkdir project.git
[host ~]$ cd project.git
[host project.git]$ git init --bare
[host project.git]$ exit
Then locally:
[local ~]$ cd project
[local project]$ git init
[local project]$ touch .gitignore
[local project]$ git add .
[local project]$ git commit
On host if i CD into the directory.. I am shown the following files (which usually sit in the .git dir)
HEAD branches config description hooks info objects refs
On local I then create a remote push: git remote add origin ssh://XXX@XXX/home/XXX/XXX/ It pushes says it has worked...
Counting objects: 3, done.
Writing objects: 100% (3/3), 210 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
However when I go back to the working folder on the server, there is nothing there.. it is just the .git files listed above.
I have done this before and it worked this way... just this time I must be doing something wrong.
UPDATE
If I try to create the repo on the server without --bare ... then I get this error on push
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error:
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
UPDATE AND RESOLUTION....
I found this which works really well http://toroid.org/ams/git-website-howto
Essentially use a --bare then have hook which copies your latest commit to a working directory!