2015-01-01 5 views
5

내 repo에서 나는 master 브랜치와 new 브랜치를 가지고 있습니다.! [거부 된] master -> master (fast-forward) 새로운 최신 지점에서

나는 한동안 new에서 일하고 있었고, 커밋을하고, 내가 가보면 푸시했다. 이제 new 번으로 가서 newest으로 전화하기로했습니다. 그래서 내가했다

git checkout -b "newest" 

그리고 지점이 성공적으로 만들어졌습니다. 파일을 추가하고 작업을 시작했습니다. 나는 몇 차례 내 변화를 저질렀다. 지침에 규정 된

C:\wamp\www\myproj>git push origin 
To https://github.com/Imray/Proj.git 
! [rejected]  master -> master (non-fast-forward) 
! [rejected]  new -> new (non-fast-forward) 
error: failed to push some refs to 'https://github.com/Imray/Proj.git' 
hint: Updates were rejected because a pushed branch tip is behind its remote 
hint: counterpart. Check out this branch and integrate the remote changes 
hint: (e.g. 'git pull ...') before pushing again. 
hint: See the 'Note about fast-forwards' in 'git push --help' for details. 

그래서, 내가 git pull을 시도,하지만 내가 가진 : 나는 origin에이 새 지점 내 변화를 추진하려고 할 때

는하지만,이 오류가 발생합니다 :

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> newest 

막혔습니다.

어떻게 새 지점과 변경 사항을 github으로 푸시합니까?

답변

2

git config push.default을 확인하십시오. 기존의 모든 브랜치를 푸시하려고하기 때문에 "matching"일 수 있습니다.
그건 default before Git 2.0+입니다.

현재 분기 만 푸시하기 위해 "simple"으로 설정하는 것이 좋습니다.

즉, 분기를 푸시려면 upstream branch을 설정해야합니다 (첫 번째 푸시). 지점의 경우

전에 밀어 결코 : 않는 지점의 경우

git push -u origin newest 

upstream repo에 존재 :

git branch --set-upstream-to=origin/master master 
git branch --set-upstream-to=origin/new new 

그런 다음 git checkout master ; git pull would 일을.

0

이 시도 :

그것이

도움이되기를 바랍니다
관련 문제