How to maintain shallow clone of a set of branches in git

后端 未结 1 698
野性不改
野性不改 2021-01-19 05:41

I\'d like to maintain a shallow, mirrored, bare clone of several branches. I will clone locally from that for different project branches. e.g.

+-------------         


        
相关标签:
1条回答
  • 2021-01-19 06:15

    I faced this question when searching for analogous sophisticated Git needs and perfectly understand that question is 2 years old. I'm answering because there are no answers at all whereas question is still very valid.

    Shallowness is primarily fetch property. So it's possible to do fetch with --depth 200 and maintain history without too old commits.

    Modern versions of Git have --shallow-exclude option. I think it's exactly what allows to "maintain everything since a certain commit".

    0 讨论(0)
提交回复
热议问题