I'm using Git under Ubuntu Linux to sync and deploy my projects.
I have a Repo on my local Linux working machine and two repos on my server, one bare repo and the one as a deployed app.
It always worked fine, but now I've created another repo for my other website I get this error:
root@vserver5:/var/www/ninethsky# git pull origin master
fatal: /usr/lib/git-core/git-pull cannot be used without a working tree.
So I have to set a GIT_WORKING_TREE
ENV-Var, but what is this exactly, where to set it?
This is my repo's .git/config:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = /home/git/ninethsky/.git
fetch = +refs/heads/*:refs/remotes/origin/*
There is another repo with bare = true
and a repo on my local working machine.
Then I removed all the repos but the initial one, and now I get:
root@vserver5:/var/www/ninethsky# git init
fatal: GIT_WORK_TREE (or --work-tree=<directory>) not allowed without specifying GIT_DIR (or --git-dir=<directory>)
root@vserver5:/var/www/ninethsky# git init --git-dir=/var/www/ninethsky
error: unknown option `git-dir=/var/www/ninethsky'
I solved the git init
problem by unsetting GIT_WORK_TREE, which was set to blank.
GIT_WORK_TREE
and GIT_DIR
are unset. git init
works again, still there is a problem with git add .
and so on when it comes to git actions in the cloned repo, which was set to bare.
Thanks, Joern.
/var/www/ninethsky
a working directory, i.e. does/var/www/ninethsky/.git
exist? Or is/var/www/ninethsky
itself a git directory? – Harmonium/var/www/ninethsky/.git
exists – Trinitrophenol/var/www/ninethsky
work? e.g. doesgit status
also produce an error? Do you have any other git environment variables set when you get that error? (env|egrep GIT
) – Aspergillumenv|grep GIT
show? – AspergillumGIT_WORKING_TREE
(note the added "ING"); is that a typo? – Homburg