2014-03-26 5 views
0

아마존 ec2에서 자식을 설정하고 로컬 우분투 컴퓨터에 연결하려고합니다. 그래서 여기에 내가 무엇을했는지 있습니다 :아마존 ec2에서 자식 설정

내 서버를 추가 ~/.ssh/config 수정 (I는 추가가 다음과 같은) 그런 다음

Host myServer 
Hostname ec2- ... .compute.amazonaws.com 
User ubuntu 
IdentityFile /path/to/pem-key.pem 

내가 sudo apt-get install git와 자식을 설치에 cd /var/www/로 이동 ssh myServer 내 서버에 ssh를 내 자식을 git init으로 설정하십시오. 이미 일부 코드가 있기 때문에 git init --bare을 사용하고 있지 않습니다.

내 로컬 컴퓨터에서 자식을 설정하려고합니다. git remote add production myServer:/var/www/ (내 로컬 코드는 여기에 있으며 일부 변경 사항이 있으므로 ec2와 동일하지 않습니다.)

지금까지 오류가 없습니다. 내가 git push 내 지역 코드를 밀어하려고 할 때하지만 점점 오전 :이 두 번째 제안에 기록 된대로

Either specify the URL from the command-line or configure a remote repository using

git remote add <name> <url> 

and then push using the remote name

git push <name> 

좋아, 내가 git push myServer을 시도하고 (이미 첫 번째 일을), 나는 다른 무엇입니까 오류 :

warning: push.default is unset; its implicit value is changing in 
Git 2.0 from 'matching' to 'simple'. To squelch this message 
and maintain the current behavior after the default changes, use: 

    git config --global push.default matching 

To squelch this message and adopt the new behavior now, use: 

    git config --global push.default simple 

See 'git help config' and search for 'push.default' for further information. 
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode 
'current' instead of 'simple' if you sometimes use older versions of Git) 

fatal: 'myServer' does not appear to be a git repository 
fatal: Could not read from remote repository. 

Please make sure you have the correct access rights 
and the repository exists. 

나는 완전히 잃어 버렸고 나는 잘못된 길 위에 있다고 생각합니다. 클라이언트에서 git push, git commit으로 서버의 로컬 변경 사항을 쉽게 푸시하고 서버에 git pull으로 배포하려면 git을 설치하기 만하면됩니다. 나는 미셸의 제안을 시도하고 클라이언트에 git remote -v 작업을 수행 할 때 내가 git push production default을 수행 할 때

, 나는 내가

error: src refspec default does not match any. 
error: failed to push some refs to 'myServer:/var/www/ 

답변

0

밀어 올바른 구문은

입니다 얻을
production myServer:/var/www/ (fetch) 
production myServer:/var/www/ (push) 

를 얻을 수
git push <remoteName> <branchName> 

귀하의 이름을 r "생산"이라고 말하면,

git push production (<branch to push>) 

이 작업을 수행합니다.

또한 당신은`자식 원격 -v` 수 있습니다 -v`

git remote -v 
+0

'자식 리모컨을 사용하여 리모컨을 확인할 수 있습니까? –

+0

제 편집을보세요. –

+0

아직 브랜치를 정의하지 않았다면'git push production'을 시도해보십시오. http://nvie.com/posts/a-successful-git-branching-model/ 및 http : // blog를 참고하십시오. .sourcetreeapp.com/2012/08/01/smart-branching-with-sourcetree-and-git-flow/ –

관련 문제