Why am I getting the message "Can't chdir to home directory" after issuing "git pull"

I just noticed that when I issue the command git pull

, I received Could not chdir to home directory

. I'm on Mac OSX, so I don't have my home directory in /home/xxxxxx

. Why could this happen? Why does git have chdir

to revert to its original state when doing the pull process?

$ git pull
Could not chdir to home directory /home/xxxxx: No such file or directory
Current branch mainline is up to date.

      

+4


source to share


2 answers


I believe git will always chdir in your home directory to read your .git * install files. Some things might be wrong, but you can most likely find the problem by doing ...

cd your_repository/.git
grep -R '/home' *

      



I think this will somehow show a problematic attitude. Try to avoid "manual commit"; instead, it would be better to use the disclosed information to figure out what is causing the problem in the first place.

0


source


I met the same problem. Log in to the repository server:



sudo mkdir /home/git
sudo chown git:git /home/git

      

0


source







All Articles