Answer the question
In order to leave comments, you need to log in
Git working_tree
I'm familiar with git.
2 machines one with mac os another virtual ubuntu 10.10
git versions are the same there and there 1. on
mac os I make a repository, I upload several files there
2.c ubuntu I make a clone and change the contents of the files
3. I push back to mac os - everything pushes and works as it should
, but when I try to change something on mac os in the repository, I get the message:
git fatal: “This operation must be run in a work tree
, why is this happening? How can I fix this and what did I do wrong?
Answer the question
In order to leave comments, you need to log in
turnip --bare cannot work, it does not have a working tree. Made so on purpose that it was impossible to make changes directly to the general turnip on the server
In general, the error "git fatal: This operation must be run in a work tree" means that you are trying to run git commands not from the working folder of the repository. The working folder is the folder that contains the .git folder (the git point) directly with the repository.
Are you doing everything as described below?
# Machine #1:
mkdir test1.git && cd test1.git
git init
echo "TEST" > README
git add README
git commit -m "Initial commit"
# Machine #2
git clone ssh://xxxxx/Users/username/test1.git
echo "Str2" >> README
git add README
git commit -m "Second commit"
git push origin master
# Machine #1
git pull origin master
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question