I found a peculiar behavior with git, and I can reproduce it every time on my machine.
If I have two local repositories, one bare inside the folder express.git
, and the other non-bare with a working tree inside the folder express, both in the same parent folder, I can do the command git pull ../express.git
from inside the express
folder. This automatically updates everything inside express
.
However, if I run the command git --git-dir /home/cisw470p/stu006/express/.git pull /home/cisw470p/stu006/express.git master
from a location no located in either git repository, then the express
repo will pull changes, but won't automatically update the working tree. I then have to run git add .
to add all changes and then make another commit from inside express
and now everything is good.
Why doesn't the long version of the command using the --git-dir option not automatically update the working tree for express
? Is there a reason for this, or did I find a bug?
EDIT: I just tried it again but edited a different file and now it worked. I'm completely lost.