My question is a direct followup to how to create a new git repository from an existing one. I have followed the procedure there to "git --bare init" and then "git push ssh://my_host/new_repo +topic1:master". The output from the second step looks like it is copying appropriately, but the new repository does not contain any of the source files and "git status" gives the error "fatal: This operation must be run in a work tree". The anonymized log is below. What am I missing? (In case it is not obvious, I am a git newbie.)
> mkdir foo
> cd foo
> setenv GIT_DIR ./.git
> git --bare init
Initialized empty Git repository in /xxx/foo/.git/
> ls -A
.git
> cd ../bar
> git push ssh://127.0.0.1/xxx/foo +for-pr:master
Counting objects: 10171, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (6647/6647), done.
Writing objects: 100% (10171/10171), 7.05 MiB | 9.62 MiB/s, done.
Total 10171 (delta 5461), reused 4992 (delta 2529)
remote: Resolving deltas: 100% (5461/5461), done.
To ssh://127.0.0.1/xxx/foo
* [new branch] for-pr -> master
> cd ../foo/
> ls
> git status
fatal: This operation must be run in a work tree