如题,我想将 git 里某个文件的所有版本文件全部都复制一份打包,但是不知道从何入手,有什么好的办法呢?
小伙看你根骨奇佳,潜力无限,来学PHP伐。
I don’t know what you want to name it. Let me make the simplest version, with additional submission value:
git log --follow --pretty=format:%H vimrc | xargs -I{} sh -c 'git show {}:vimrc > vimrc.{}'
git log --follow file
You can get the commits of all historical versions of this file.
Based on this information, you can write a script to extract the file contents of each version and then package them.
Refer to @Evian’s answer
git log --follow --pretty=format:%H README.md|awk '{print "git show "":README.md > README.md."NR"."}'|sh
I don’t know what you want to name it. Let me make the simplest version, with additional submission value:
You can get the commits of all historical versions of this file.
Based on this information, you can write a script to extract the file contents of each version and then package them.
Refer to @Evian’s answer