I found peculiar behavior with git, and I can play it every time on my machine.
If I have two local repositories, one of which is inside the express.git
folder, and the other is not bare with a working tree inside the express folder, as in one parent folder, I can run the git pull ../express.git
from inside express
folders. This automatically updates everything inside express
.
However, if I run the git --git-dir /home/cisw470p/stu006/express/.git pull /home/cisw470p/stu006/express.git master
command git --git-dir /home/cisw470p/stu006/express/.git pull /home/cisw470p/stu006/express.git master
from a location not located in the git repository, then the express
repository will cause changes but will not automatically update the working tree. Then I have to run git add .
to add all the changes, and then make another commit inside express
, and now everything is fine.
Why is not the long version of the command with the parameter - git-dir not automatically update the working tree for express
? Is there a reason for this, or have I found an error?
EDIT: I just tried again, but edited another file, and now it worked. I am completely lost.
source share