git copy particular version of repository

后端 未结 2 1157
日久生厌
日久生厌 2021-01-03 14:50

I\'m new to git so forgive me if this is a dumb question. I have a git repository and I need to copy a particular revision of the repository to its own separate directory. T

2条回答
  •  南方客
    南方客 (楼主)
    2021-01-03 15:38

     git archive master >specificversion.tar
    

    replace master by a commit identifier

    If you want to immediately 'check it out', consider

     git archive master | (cd /tmp/exportlocation && tar x)
    

    git archive (as usual) comes with a load of other useful options

提交回复
热议问题