2017-09-26 29 views
1

실패 : 당신은 원격에 대한 퍼팅하는 URL을 변경해야자식 허브 저장소 생성 내가 다음 명령을했으나 실패

> cd SecurityAlert/ 
> sudo apt-get install git 
> git init 
> git add . 
> git config --global user.email "[email protected]" 
> git config --global user.name "user" 
> git commit -m "First commit" 
> git remote add origin https_link_github.com/user/SecurityAlert 
> git push origin master 

To https_link_github.com/user/SecurityAlert
! [rejected] master -> master (non-fast-forward)

error: failed to push some refs to 'https_link_github.com/sandeepmhptr/SecurityAlert' hint: Updates were
rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

git pull 

There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details git pull

If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=origin/ master

> git remote add -v 

> git remote -v 

답변

0

. 당신이 좋아 밀어 할 수 있어야합니다, 당신의 Github에서의 환매 특약 올바르게 설정 한,

> git remote add origin https://github.com/sandeepmhptr/SecurityAlert 

다음 -하지만 문제는 당신이 가지고 :

> git remote add origin https_link_github.com/sandeepmhptr/SecurityAlert 

이 있어야한다 :

당신은 사용 푸시와 함께 오류 메시지가 나타나면 이미 원격 저장소 ()에 커밋 된 것처럼 보입니다. 사용하는 명령으로, Github에서에 새 원격 기존의 repo를 밀어

의 Github에서 리포는에 README.md 또는 .gitignore 파일을 추가없이 를 초기화해야합니다. 이들을 추가 한 경우, 가장 쉬운 방법은 처음으로 푸시하기 전에 repo를 삭제하고 파일을 추가하지 않고 다시 작성하는 것입니다. 이 경우 정확하게 동일한 이름으로 다시 작성하거나 URL을 업데이트하십시오.

강제로 푸시 할 수도 있지만 기본적으로 원격 저장소를 로컬 저장소의 기록으로 덮어 씁니다. 이것이 새로운 저장소이고 아직 다른 사람이 다운로드하지 않은 경우 다른 옵션입니다. 원격 REPO 유지하려는 이미 일부 커밋이있는 경우 당신이 밀어 전에


는, 당신은 지역의 repo에 사람들을 동기화해야합니다. 이는 차이점이 무엇인지, 그리고 병합 기록이 어떻게 나오길 원하는지에 따라 매우 자세하게 나타날 수 있습니다.

+0

원격 URL은 git remote add origin입니다. https://github.com/sandeepmhptr/SecurityAlert, 여기 사이트의 일부 문제로 인해 git remote add origin https_link_github.com/sandeepmhptr/SecurityAlert을 작성했습니다. 허용되지 않았습니다. 2 개 이상의 URL이 있습니다. – chinmay

+0

안녕하세요.이 모든 단계를 다시 시도했는데 성공했습니다. – chinmay

+0

좋아요. 리모콘이 이미 초기화 된 것처럼 보입니다. 좀 더 자세한 정보를 답에 추가했습니다. 이것이 도움이되었거나 귀하의 질문에 답변 한 경우 체크 표시 또는 투표에 감사드립니다. – LightCC