git --bare 옵션 사용시 로컬 저장소 업데이트 방법은 무엇일까요?
http://wiki.kldp.org/wiki.php/GitGuideForKernelDevelopment 와
웹의 내용을 바탕으로 git를 테스트해보고 있습니다.
wiki 내용이 살짝 오래되었지만, 아직 거의 유효하네요.
linux-2.6에 대한 로컬 미러를 만들고, 거기서 브랜치를 만들어서 작업하는 방식으로 해보려고 하는데요.
아래와 같이 clone을 하고, 위 링크의 내용대로 git remote add linus git://... 이렇게
upstream tracking하는 부분도 설정해 주었습니다.
git clone -n --bare <a href="//git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git" rel="nofollow">git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git</a> linux-2.6-dev git clone git://localhost/linux-2.6-dev linux-2.6-mine git remote add linus <a href="//git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git" rel="nofollow">git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git</a>
그런데 이렇게 만들면 linux-2.6-dev 아래에는 파일 checkout이 안 되어 있어서 그런지, 해당 디렉토리에서
git pull을 해도 upstream의 신규 변경 사항이 업데이트가 안 되네요.
반면에 아래처럼 그냥 clone을 해오면, git pull로 단번에 upstream 내용이 업데이트가 됩니다.
git clone <a href="//git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git" rel="nofollow">git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git</a> linux-2.6
링크내용대로 git fetch -v linus 이렇게 하고, 로컬 브랜치(linux-2.6-mine)에서 git pull을 해도 소용이 없네요.
linux-2.6-dev 쪽 아래의 내용들을 살펴보면, FETCH_HEAD나 ref쪽은 upstream의 최신 commit id값이
들어가 있기는 한데, 정작 git log나 linux-2.6-mine에서의 git pull로 확인해보면 upstream의 최신 내용이
적용되지 않는 상황입니다.
[root@host linux-2.6-dev]# git show-ref |grep master 74fca6a42863ffacaf7ba6f1936a9f228950f657 refs/heads/master 0d03d59d9b31cd1e33b7e46a80b6fef66244b1f2 refs/remotes/linus/master [root@host linux-2.6-dev]# cat HEAD ref: refs/heads/master [root@host linux-2.6-dev]# cat FETCH_HEAD 0d03d59d9b31cd1e33b7e46a80b6fef66244b1f2 not-for-merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
아마 workflow가 좀 잘못된 것 같은데, --bare 옵션을 사용했을 때 해당 저장소의 update는 어떤 방식으로
하시는지 궁금합니다.
그리고 git를 운영할 때 좋은 구조나 방식도 있다면 조언 부탁드립니다~
댓글 달기