[완료] git에서 특정 날짜(일시) 시점으로 fetch할 수 있는 방법이 있나요?

whatwant의 이미지

특정 커밋이라던지 특정 태그, 특정 브랜치로 가고 싶은 것이 아니라

master 브랜치에서 특정 일시 시점의 소스를 갖고 싶은데, 아무리 뒤져도 알 수가 없네요.

git log 등을 보고 싶은 것이 아니라 그 시점의 소스들을 갖고 싶은 상황입니다.

마냥의 이미지

git log 라든지 gitg, giggle 같은 툴로 원하는 commit을 찾아서요, 해당 commit id로 checkout 하면 됩니다.

$ git checkout (commit id)

이렇게 하면 그 시점으로 돌아갈 수 있어요. 원하면 tag나 branch도 만들 수도 있구요.

원래대로 돌아올 땐 git checkout master 하면 됩니다.

----
Gentoo Rules!

Gentoo Rules!

bushi의 이미지

[bushi@rose linux-2.6]$ head -4 Makefile
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 34
EXTRAVERSION = -rc3
[bushi@rose linux-2.6]$ 
[bushi@rose linux-2.6]$ git rev-parse --after=@{2010-01-01}
--max-age=1262347252
[bushi@rose linux-2.6]$ git rev-list `git rev-parse --after=@{2010-01-01}` master | tail -1
c9c041fcb1a4d69ed4791f00b57554eeb341d148
[bushi@rose linux-2.6]$ 
[bushi@rose linux-2.6]$ git show c9c041fcb1a4d69ed4791f00b57554eeb341d148|head -3
commit c9c041fcb1a4d69ed4791f00b57554eeb341d148
Author: Anisse Astier <anisse@astier.eu>
Date:   Thu Dec 31 16:41:33 2009 +0100
[bushi@rose linux-2.6]$ 
[bushi@rose linux-2.6]$ 
[bushi@rose linux-2.6]$ git checkout -b my20100101_snapshot c9c041fcb1a4d69ed4791f00b57554eeb341d148
Switched to a new branch 'my20100101_snapshot'
[bushi@rose linux-2.6]$ 
[bushi@rose linux-2.6]$ head -4 Makefile
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 33
EXTRAVERSION = -rc2
[bushi@rose linux-2.6]$

OTL

whatwant의 이미지


한 수 멋지게 배웠습니다~!!!

아직 궁금한 부분이 살짝 있지만 그 정도는 혼자서 풀어나가야 할 숙제겠죠~^^

정말 멋진 가르침이었습니다!!!

마잇의 이미지

git archive 명령도 한 번 보세요. 특정 커밋의 zip 파일이나 타르볼을 만들어줍니다.

--
마잇


--
마잇