TaveBand / daeilband_fe

0 stars 0 forks source link

Merge : 브랜치에서 메인으로 mergeconflict 발생! #1

Open tldms0507 opened 5 months ago

tldms0507 commented 5 months ago

PS C:\Users\tldms\taveproject_FE> git commit -m "FEAT: 검색기능추가, 세션 상세페이지추가" On branch kse Your branch and 'origin/kse' have diverged, and have 3 and 8 different commits each, respectively. (use "git pull" to merge the remote branch into yours)

Last command done (1 command done): pick 8d813265 FEAT: 검색기능 추가(모집게시판)
//어제 푸시하려다 실패
Next command to do (1 remaining command): pick a1c6ddbb FEAT: 검색 기능 추가 //방금 푸시하려다 실패 (use "git rebase --edit-todo" to view and edit)
You are currently editing a commit while rebasing branch 'kse' on '9be616c1'. (use "git commit --amend" to amend the current commit) (use "git rebase --continue" once you are satisfied with your changes)

nothing to commit, working tree `clean```

tldms0507 commented 5 months ago

git push origin kse -> To https://github.com/TaveBand/daeilband_fe.git ! [rejected] kse -> kse (non-fast-forward)
error: failed to push some refs to 'https://github.com/TaveBand/daeilband_fe.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.

yys1681 commented 5 months ago

로컬 브랜치 kse가 원격 브랜치 origin/kse보다 뒤쳐져 있어서 발생하는 문제. 커밋변경된 최신 수정사항을 업데이트한 후 merge 후 커밋해서 push해야 하는데 이 부분이 안된 것으로 보임. 아마도 커밋한 후 수정사항이 push 안되고 작업한 내용이 그대로 남아있어서 그런거 같은데 첫 커밋 푸시하다 실패한 이후 그 커밋이 아직 남아있는 상태에서 새롭게 수정하고 다시 커밋했기에 충돌발생으로 보임. 에러 메시지를 보면 rebase쓴 것 같긴 한데 git rebase --abort로 rebase 작업 중단하고 최신으로 git fetch origin 업데이트해보고 git merge origin/kse 병합해보면 merge conflict 나올 거에요. 그게 똑같은 부분을 다른 방식으로 수정해서 그런거니 수동으로 해당부분 변경해주고 다시 push하면 될 것 같아요 충돌해결 된 것 보이면 git push origin kse해서 push하면 됩니다. 이때 브랜치는 무조건 checkout을 통해 kse로 변경해주신다음 진행해주세요

tldms0507 commented 5 months ago

git merge origin/kse 하니까 fatal: refusing to merge unrelated histories 라고 뜨는데 git pull origin kse --allow-unrelated-histories 이걸로 시도해보았으나 From https://github.com/TaveBand/TaveBand_FE_demo

tldms0507 commented 4 months ago

! [rejected] kse -> kse (non-fast-forward) error: failed to push some refs to 'https://github.com/TaveBand/daeilband_fe.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.

PS C:\Users\tldms\taveproject_FE> git pull origin kse From https://github.com/TaveBand/daeilband_fe

yys1681 commented 4 months ago

git fetch origin git merge origin/kse --allow-unrelated-histories git add <충돌_해결된_파일> git commit git push origin kse

tldms0507 commented 4 months ago

PS C:\Users\tldms\taveproject_FE> git push origin main To https://github.com/TaveBand/daeilband_fe.git ! [rejected] main -> main (non-fast-forward) error: failed to push some refs to 'https://github.com/TaveBand/daeilband_fe.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.