git copy particular version of repository

后端 未结 2 1159
日久生厌
日久生厌 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:43

    Update

    It's better to use the archive option mentioned by Sehe


    What I would do is just checkout that particular version:

    git checkout 
    

    And then just copy all the contents except for the .git dir

    rcopy --exclude=.git . ~/some-folder/
    

    And then you could do

    git checkout master
    

    to reset the repository to the master branch again.

提交回复
热议问题