2016-07-31 2 views
1

두 번째 오류 git push에서 오류가 발생했습니다. 동일한 풀 요청에 몇 가지 새로운 변경 사항을 추가하고 싶습니다.이 문제를 해결하는 방법은 무엇입니까? 감사.이상한 git 푸시 오류

망할 놈의 작업

git checkout -b newFooBranch 
git add <name of file changed> 
git commit -m 'add some initial changes' 
git push origin newFooBranch 

// make some changes 
git add <name of same file changed> 
git commit -m 'add some new changes on the same file' 
// met with error when executing below command 
git push origin newFooBranch 

오류 메시지,

To [email protected]:foo/goo.git 
! [rejected]  newFooBranch -> newFooBranch (non-fast-forward) 

error: failed to push some refs to '[email protected]:foo/goo.git' 
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 <remote> <branch> 

If you wish to set tracking information for this branch you can do so with: 

    git branch --set-upstream-to=origin/<branch> newFooBranch 

관련하여, 린

+1

다른 사람이 해당 지점을 커밋하고 푸시했다면 로컬 HEAD 포인터를 옮겼습니다. 아마도'git checkout' 명령을 사용했을 것입니다. github을보고 커밋이 로컬 커밋과 다른지 확인하십시오. –

+0

@AndyRay, 감사합니다. "github을보고 어떤 커밋이 당신의 로컬 커밋과 다른지 확인하는 것"은 무엇을 의미합니까? github.com에서 볼 섹션이 있습니까? –

답변

1

중 하나를 수행합니다

git pull

또는 :

git remote update 
git rebase origin/newFooBranch 

을 변경 사항을 추진하기 전에.

+0

감사합니다. Nishant 님, 투표를하고 git pull을 실행할 때 오류가 발생했습니다. 원래 게시물의 edit 1 섹션에 게시하십시오. 의견이 있으시면 잘 될 것입니다. –

+1

'git pull origin newFooBranch'을 시도하십시오. –

+1

오류 메시지에'git branch --set-upstream-to = origin/newFooBranch newFooBranch' 명령을 사용할 수도 있습니다. 본질적으로 자식은 어떤 브랜치를 끌어 올지 모르기 때문에 (새로운 브랜치가 업스트림없이 만들어 짐에 따라) 좀 더 구체적으로 물어볼 것이다. –