A git pull
does a fetch
followed by a merge
, and you can't merge without a working tree. (There would be nowhere to resolve merge conflicts if they should arise.)
Instead, you could just fetch. Assuming your main repository is configured as a remote called origin on your personal repository:
$ git fetch origin master:master
Note that this will only be successful if the master branch of your personal repository is mirroring the master branch of the main repository. Otherwise, Git will reject the non-fast-forward fetch.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…