나는 자식 안에 깊이 묻혀 있습니다. Git 리베이스가 빨리 감기를 표시합니다.
어떻게 거기 않았다
내가 자식 전문가가 아니다. 세부 사항이 부족한 경우 설명해주십시오. 며칠 전에 다음 명령을 실행하여 변경 사항을 원격 지점으로 푸시했습니다.
% git checkout master
% git pull
% git checkout redactor_changes <-- this is the branch that I made my changes
% git commit -m "changes" # I added my changes previously
% git rebase master
% git push origin redactor_changes # pushed changes to remote branch
모든 사용자에게 마스터 분기의 변경 사항을 병합 할 수있는 쓰기 권한이있는 것은 아닙니다. 원격 저장소에 대한 쓰기 권한이있는 사람은 갈등이 있고 rebase를하고 다시 제출한다고했습니다. 그래서 오늘 다음 명령을 정확한 순서로 실행했습니다.
[email protected]:~/oblog$ git add oblog/static/css/styles-custom.css
[email protected]:~/oblog$ git add oblog/static/js/redactor.upload_image.js
[email protected]:~/oblog$ git add oblog/static/images/loading.gif
[email protected]:~/oblog$ git commit -m "Throw a toast when user upload an non-image file with image extension"
[email protected]:~/oblog$ git branch
[email protected]:~/oblog$ git checkout master
[email protected]:~/oblog$ git pull
[email protected]:~/oblog$ git checkout redactor_changes
[email protected]:~/oblog$ git rebase master
[email protected]:~/oblog$ git merge master
[email protected]:~/oblog$ git branch
[email protected]:~/oblog$ git push origin redactor_changes
이 명령 집합은 내가 도망 갈 수없는 월풀로 나를 빨아 들였습니다.
증상 :
! [rejected] redactor_changes -> redactor_changes (non-fast-forward)
error: failed to push some refs to 'https://git.<domain>.com/web/oblog.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.
그래서 나는 동료 SO
- https://stackoverflow.com/a/20467414/1431184
- https://stackoverflow.com/a/6897674/1431184 의 조언을 따라 위의 코드의
마지막 줄은 오류를 다음 던졌습니다
하지만 문제는 계속됩니다.
는LABLE는 : 내가 마스터 (로컬) 내 지점을 리베이스
, 내가 수동으로 수정하고 REBASE의 --continue을 일부 충돌이 발생합니다. Rebase가 성공했습니다. 그런 다음 다시 출처로 내 지점을 밀어, 그것은 나에게 같은 오류를 보여 주었다! [거부].
git와 SO가 제안한 것처럼 원격 지점의 변경 사항을 로컬 지점 (redactor_changes)으로 가져옵니다. 그런 다음하여 LABEL에 저를 다시 넣습니다
git rebase master
을 실행. 이것은 단지 계속됩니다.
내 push 명령은 마스터로 리베이스하지 않을 경우 작동하지만 원격 git의 소유자는 내 브랜치 (redactor_changes)를 마스터에 병합하려고 할 때 충돌을 계속 볼 수 있습니다.
제가보기에 하나의 문제는'git rebase master'를 실행 한 후 즉시'git merge master '를했기 때문입니다. 왜이 짓을 했나요? –
내 의도는 변경 사항을 마스터와 병합하여 내 지점을 최신 상태로 만든 다음 rebase를 실행하여 지점을 마스터에 배치하는 것이 었습니다. 그게이 모든 문제를 일으킨 것 같아요? – printfmyname