I'm following the Git Pro book ( http://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server ) to set up my first git remote server on Ubuntu. After I follow this:
$ git remote add origin git@gitserver:/opt/git/inventory.git
$ git push origin Windows
I receive this message:
Counting objects: 33, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (28,28) done.
Writing objects: 100% (33/33), 7.30 KiB | 0 bytes/s, done.
Total 33 (delta 13), reused 0 (delta 0)
To git@gitserver:/opt/git/inventory.git
* [new branch] Windows -> Windows
But when I type git status
on the remote server (in /opt/git/inventory.git/) I get the error message fatal: This operation must be run in a work tree
The remote repository appears to not contain any of the files from the local repository and when I clone the remote repository into a different local folder there are no files, just the .git folder.
I have looked at other related questions on here:
fatal: This operation must be run in a work tree
Why am I getting the message, "fatal: This operation must be run in a work tree?"
Getting “fatal: This operation must be run in a work tree?” on bare repository
but am no clearer as to why this is happening and what i can do to remedy it.