2010-04-30 5 views
1

내 친구와 함께 프로젝트 작업에 사용하는 인터넷에 서버 (ssh를 통해 제공됨)가 있습니다. git을 소스 제어에 사용하기 시작했습니다. 다음과 같이 우리의 설치가 현재 :ssh를 통한 개인 서버의 워크 플로우와 같은 github

  • 친구라는 git --bare initserver에 저장소를 생성 내가 git clone [email protected]:/git_repos/project.jesse.git
  • 를 사용 project.jesse.git
  • 그때 내 로컬 컴퓨터에 serverproject.jesse.git를 복제에 serverproject.friend.git를 복제
  • project.friend.git 내 로컬 컴퓨터에서 작업하고 로컬 컴퓨터에 커밋합니다. 내 변경 사항을 project.jesse.git에 넣고 server에 넣으려는 경우 git push origin master을 사용합니다. 제 친구가 project.friend.git에서 일하고 있습니다. 내가 그의 변화를 원할 때 나는 pull [email protected]:/git_repos/project.friend.git을한다.

    localpc:project.jesse jesse$ git push origin master 
    Counting objects: 100, done. 
    Delta compression using up to 2 threads. 
    Compressing objects: 100% (76/76), done. 
    Writing objects: 100% (76/76), 15.98 KiB, done. 
    Total 76 (delta 50), reused 0 (delta 0) 
    warning: updating the current branch 
    warning: Updating the currently checked out branch may cause confusion, 
    warning: as the index and work tree do not reflect changes that are in HEAD. 
    warning: As a result, you may see the changes you just pushed into it 
    warning: reverted when you run 'git diff' over there, and you may want 
    warning: to run 'git reset --hard' before starting to work to recover. 
    warning: 
    warning: You can set 'receive.denyCurrentBranch' configuration variable to 
    warning: 'refuse' in the remote repository to forbid pushing into its 
    warning: current branch. 
    warning: To allow pushing into the current branch, you can set it to 'ignore'; 
    warning: but this is not recommended unless you arranged to update its work 
    warning: tree to match what you pushed in some other way. 
    warning: 
    warning: To squelch this message, you can set it to 'warn'. 
    warning: 
    warning: Note that the default will change in a future version of git 
    warning: to refuse updating the current branch unless you have the 
    warning: configuration variable set to either 'ignore' or 'warn'. 
    To [email protected]:/git_repos/project.jesse.git 
        c455cb7..e9ec677 master -> master 
    

    내가 걱정해야이 경고 무엇인가 :

모든 것은 내가 git push origin master을 수행 할 때 그러나, 지금 다음과 같은 오류가 발생하고, 잘 동작하는 것? 내가 말했듯이 모든 것이 효과가있는 것처럼 보입니다. 내 친구가 내 지점에서 내 변경 사항을 가져올 수 있습니다. 그는 로컬 컴퓨터에 액세스 할 수 없으므로 서버에 복제본을 가지고 있으므로 액세스 할 수 있습니다. 더 잘할 수있는 것이 있습니까?

감사합니다.

+0

'master'가'project.jesse.git'를 가리키고 있습니까? –

+0

@matt b, 마스터에게 보내는 변경 사항은 project.friend.git에 나타나지 않으므로 자신이 가져올 때까지 사용한다고 가정합니다. –

답변

4

베어 리포지토리를 서버에 설정해야합니다. 베어 리포 지 토리는 보통 저장소 루트의 .git 디렉토리에있는 버전 히스토리 정보 만 포함합니다. 다른 저장소와 마찬가지로 해당 저장소에서 복제하거나 밀어 넣을 수 있습니다. 이미 this question를 참조하여 경고에 관해서는 몇 가지 버전 기록 베어 복제를

git clone --bare git://some/where 

을 할 경우

베어 저장소는

git init --bare 

만들어집니다.

+0

내 나쁜 ... 나는 첫 번째 저장소를 만들었을 때 git init --bare를 사용했다. +1 링크. –

+0

제가 누락 된 부분은 저장소를 복제했을 때의 것입니다. 감사! –