Single working branch with Git

前端 未结 7 1461
予麋鹿
予麋鹿 2021-01-01 15:21

Bounty short description

Is there a portable way to use a single repository w/ multiple checkouts? As an alternative to ha

7条回答
  •  渐次进展
    2021-01-01 15:52

    If you git clone with a local path, everything under .git/objects (that is, most of the commits and data in your repository) is hardlinked to the old repo wherever possible and takes up next to no disk space. So if you want two different working directories, it's not very expensive to just clone your repo locally. Trying to manage two different working directories from one repository might work, but it's not worth the trouble.

    Basically, run git clone /path/to/old/repo new_repo and everything will Just Work.

提交回复
热议问题