나는 remote_branch
인 remote git repository
을 가지고 있습니다. 내 컴퓨터에 remote_repository
을 복제하고 local_branch
을 만들었습니다.원격 및 로컬 저장소
이제 push
으로 변경하려면 local_branch
에서 remote_branch
으로 변경하십시오. 은 지내요, 나는 upstream flag
git branch --set-upstream-to=origin/remote_branch local_branch
I 다음 commit
및 stage
내 변경을 설정하고 remote_branch
에 변경 git push
받는보십시오.
To [email protected]
! [rejected] remote_branch -> remote_branch (non-fast-forward)
error: failed to push some refs to '[email protected]'
hint: Updates were rejected because a pushed branch tip is behind its
remote counterpart. If you did not intend to push that branch, you may
want to specify branches to push or set the 'push.default'
configuration variable to 'simple', 'current' or 'upstream' to push
only the current branch.
, 나는 push
때 의미가 있습니다
git push origin local_branch:remote_branch
변경 : 나는이 메시지가 나타납니다. 내가 뭘 잘못하고 있니?
트릭을하지 못했습니다. – Stophface
다른 사람이 원격 저장소에 다른 커밋을 추가하는 동안 변경 사항 (커밋)을'local_branch'에 추가 한 것일 수 있습니까? 이 경우 밀어 넣기 전에 변경 내용을 병합하거나 리베이스해야 할 수 있습니다. 실제로 밀어 넣기가 수행되었으므로 다른 밀어 넣기 작업이 수행되었습니다. 'gitk --all'은 현재 상태를 시각화하는 데 도움이 될 수 있습니다. –
nope. 나는'local_branch'에서'remote_branch'을 꺼내서'local_branch'에서 무엇인가를 변경하고'local_branch'을'remote_branch'로 푸시하려고했습니다. 같은 효과. – Stophface