How to detach the local git repository from its working directory?

前端 未结 2 2032
猫巷女王i
猫巷女王i 2021-01-23 18:16

Is this feasible?

I would like to have the .git directory on another drive than the checkout directory. I could not find a way to detach both.

The r

2条回答
  •  感情败类
    2021-01-23 18:30

    I'd really suggest keeping your entire repo on your preferred drive. You can then put a bare repo on the beyond-your-control drive, and push to it. This is the best way to minimize your interactions with the bad storage.

    If for some reason you must split a repo across drives, why not just create the repo on one drive, move the .git directory to the other drive, then symlink .git in your repo to the relocated .git directory.

提交回复
热议问题