[Git] git push error...

Maria Kim·2021년 11월 10일
0


에러가 난 코드 git push origin feature/sunghyun

에러창

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.

무서운 깃에러 대부분 깃에러가 뜨면 코드를 쓸수록 꼬이는 느낌이 들어 코드를 더 쳐야 할지 고민이 많이 든다...

문제가 생긴 이유

우선 마지막 코드를 고치기 위해 아래 깃허브 공식 문서를 참고해
[Github Docs] Changing a commit message

git commit --amend 를 사용해 마지막 commit을 고쳤다. 고쳐지기까지는 했으나 그 수정 부분을 github에 push 하려고 하니 뜨는 위의 에러... (왜 그러니 ㅠㅠ)

다행히 이번에는 많이 꼬이지 않고 아래 방법으로 바로 해결할 수 있었다.

해결방법

브랜치에 + 을 붙여 강제로 push 했다.
내가 변경한 것은 commit 부분만 이었기 때문에 문제가 되지 않았다.

 git push origin +feature/sunghyun 

휴... 오늘은 다행히 꼬이지 않고 빨리 해결방법을 찾아 다행이다...

profile
Frontend Developer, who has business in mind.

0개의 댓글