근본 원인 :이 local/production
이 origin/production
를 추적하지 않습니다 그것이 나에게 나타나는 짧은 설명을 절단합니다. 이것을 git branch -avv
으로 확인할 수 있습니다.
는 약 git push
는 :
git push ... [<repository> [<refspec>...]]
The special refspec : (or +: to allow non-fast-forward updates) directs git to
push "matching" branches: for every branch that exists on the local side, the
remote side is updated if a branch of the same name already exists on the remote
side. This is the default operation mode if no explicit refspec is found (that is
neither on the command line nor in any Push line of the corresponding remotes
file---see below).
간단한의 결과로 인해 : 인수없이 git push
합니다 (git-push(1)
매뉴얼 페이지에서) 해당 지역의 추적 지점에 업데이트 한 모든 원격 브랜치를 업데이트합니다 git push
은 로컬 브랜치에서 수행 된 변경을 잊어 버린 경우 가끔 예상치 못한 경우가 있으므로 개인적으로 내가 푸시 할 브랜치를 명시 적으로 지정하고 싶습니다.(단
git push -u origin local/production:production
: 당신이 local/production
이 origin/production
추적하려면
git push origin local/production:production
, 당신은 옵션 -u
을 사용 origin/production
의 local/production
추적 분기를 만들 수 있습니다 귀하의 경우에는 당신이 무엇을 원하는 것 같다 한 번 필요함). 그런 다음 원점에서 local/production
으로 당길 수 있습니다.
요약은 : 당신은 지점과 git push
의 독특한 의미를 추적의 개념을 이해할 필요가있다.
P. 지점 이름 local/production
의 선택에 대해 궁금합니다. 왜 production
가 아닌가? 이미 production
origin/production
을 추적하고 있으며 로컬 개발을 위해 local/production
을 사용하고 계신지 의심됩니다. 이 경우 합리적인 작업 흐름은 다음과 같이이다 : 새로운 커밋이 production
에있는 경우
git pull origin production:production
이 production
- 에 대한 변경 사항을 뽑아, 그
local/production
중 하나를 리베이스 다음 뒤에입니다 당신의 production
에 local/production
(또는 local/production
에 production
)
- 당신이
production
에 변경, merge
또는 cherry-pick
커밋을 밀어 git push origin production:production
로 변경을 추진하려는 순간을 병합합니다.
바로 @FooF입니다. 문제는 브랜치 로컬/프로덕션을 연결 (또는 추적)하지 않았기 때문입니다. 그래서,'git push '(인수없이)는이 가지를 감지하지 못했습니다. 또 다른 해결책은 git config에'git config remote.origin.push local/procution : refs/heads/production'을 추가하는 것입니다. 어쨌든 나는 여러분이 푸시 할 브랜치를 명시 적으로 지정하는 것에 동의합니다. –