2012-06-19 4 views
1

새 프로젝트를 만들고 이전 프로젝트를 Git을 통해 버전 제어되도록 설정하기위한 작업 과정을 설정하려고합니다. 마침내 한 단계를 제외하고 모두 의미가 있습니다. 새 프로젝트를 만들 때 Git을 초기화하고 초기 커밋을 수행하면 git clone --bare ./myproject //myserver/myshare/myproject.git을 수행합니다. 그런 다음 리모콘을 설정합니다 (git remote add origin //myserver/myshare/myproject.git). 이들은 잘 작동하는 것 같습니다. 그러나, 내가 git branch -a 할 때, 그것은 원격에 마스터 브랜치가 있다는 것을 보여주지 않습니다.git clone --bare에는 분기 마스터가 포함되지 않음

내가 지금 당장 돌아 다니는 방법은 다른 위치에 git clone //myserver/myshare/myproject.git이고 방금 리모컨이 이미 설정되어 있고 마스터 브랜치가 리모컨에 있습니다. 나는 무엇이 잘못 될 수 있는지 전혀 몰랐다. 특히 리모컨이 어떤 방식으로 설정되어 있는지에 대한 유일한 차이점이 있기 때문이다.

미리 감사드립니다.

답변

2

아무런 문제가 없습니다. git clone 사람이 페이지에서 :

--bare 
     Make a bare GIT repository. That is, instead of creating <directory> and placing the administrative files in <directory>/.git, make the <directory> 
     itself the $GIT_DIR. This obviously implies the -n because there is nowhere to check out the working tree. Also the branch heads at the remote are 
     copied directly to corresponding local branch heads, without mapping them to refs/remotes/origin/. When this option is used, neither remote-tracking 
     branches nor the related configuration variables are created. 

베어 저장소는 masterrefs/remotes/origin/master 포인터를 저지 매핑되지 않는,하지만 그들은 필요가 없습니다. 베어 레포는 vital when setting up remotes that others might push to or pull from,이지만 they aren't where you do day-to-day dev work.origin 인 것 같습니다. 다른 리모컨을 설정하지 않는 한 로컬 저장소에 git clone //myserver/myshare/myproject.git을 붙이십시오.

+0

내 기존 프로세스가 올바른지 말하고 있습니까? 모든 병합과 작업이 로컬에서 수행되어야한다고 생각합니다. // myserver는 모든 사람이 변경 사항을 밀어 넣을 수있는 중앙 저장소로 사용하기를 원합니다. 그리고 우리가 계층화 된 분기를 갖기를 원합니다 (마스터가 릴리스되고, 마침내 기능을 통합하기 전에 기능을 통합하는 테스트 분기 -이 두 분기는 모두 repo에서 사용할 수 있습니다. 당신의 응답을 주셔서 감사합니다. – Ethan

+0

네가'// myserver'를 모든 사람이'push '또는'pull' 할 수있는 중앙 저장소로 원한다면 잘 설정해야합니다. 새로운 브랜치를 넣으려면 로컬 저장소에서 브랜치를 분기하고 원래 브랜치로 푸시하십시오. 예 : 'git checkout -B testing master && git push origin testing' – Christopher

+0

좋은 소리입니다. 다시 한번 감사드립니다. – Ethan