G
G
Gibbzy2011-04-03 16:44:37
git
Gibbzy, 2011-04-03 16:44:37

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

4 answer(s)
I
ILYA, 2015-04-15
@iliacmd

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

H
homm, 2011-04-03
@homm

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.

6
69from, 2012-03-04
@69from

Also faced this problem. Same error in working folder

J
joymax, 2012-03-04
@joymax

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 question

Ask a Question

731 491 924 answers to any question