Home
Sign Up
Sign In
›
Pro Git
›
Atlassian Git Tutorial
›
Pro Git 简体中文翻译
›
GitX
Advertisement
V2EX
›
git
可不可在另外一个文件夹里拷贝某个历史版本出来?
yhhy168
·
Mar 1, 2013
· 4152 views
This topic created in 4999 days ago, the information mentioned may be changed or developed.
git 新手,想从 github 上拷贝之前提交的某个版本(例如3天前的某个版本)的数据到另外的文件里,有什么命令可以做到呢?
版本
某个
拷贝
6 replies
•
1970-01-01 08:00:00 +08:00
yhhy168
OP
Mar 1, 2013
1
自己顶下,这个 git 无法实现?
swulling
Mar 1, 2013
2
git archive
TankyWoo
Mar 1, 2013
3
就我想到的,可以:
把这个repo复制一份,git log找到要回滚的历史版本号,然后reset回滚到那个版本,然后你就可以拷出来了
binux
Mar 1, 2013
4
checkout 回去,拷贝,再 checkout 回来就行了呗
yhhy168
OP
Mar 1, 2013
5
@
yhhy168
@
swulling
@
TankyWoo
上面说的 archive reset checkout等命令都还没用过,的确是 git 菜鸟:(
好的,我自己对这些命令研究下,试验下先
swulling
Mar 1, 2013
6
@
yhhy168
举个例子吧
git archive --format tar.gz --prefix xxx/ -o ../xxx.tar.gz HEAD
把HEAD改成你想要打包的Revision即可
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Privacy
·
Solana
·
1535 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 30ms ·
UTC 00:32
·
PVG 08:32
·
LAX 16:32
·
JFK 19:32
♥ Do have faith in what you're doing.
❯