git
git push origin master >> git pull origin master // merge
YG - 96년생 , 강아지 있음, 개발자 희망
2021. 12. 11. 11:22
에러 내용
git에 올려둔 파일에 README.md를 git 페이지에서 수정한 후 나중에 코드를 수정하고 깃에 올리려고 하니 에러가 났습니다.
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first 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.
인터넷에 검색해보니
git pull origin master 을 하면 된다고 하였다.
이러한 화면이 나오는데 아무리 입력을 해도 동작이 안되어서 다시 검색을 하였습니다..
Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
merge 하려는 이유를 적으라고 나와 있습니다.
이유를 적은 후 ^X 가 무엇인지 또 몰랐었는데 컨트롤 X 라는 뜻이였습니다.
merge 하려는 이유를 적은 후 컨트롤 X 를 하게 되면 파일명을 적으라고 하는데 파일명을 정한 뒤 엔터를 누르면 됩니다.
- git pull origin master 하기.
- merge 하려는 이유 적기
- 컨트톨 X 로 파일 저장하기
- 파일명 엔터로 저장하기
- 다시 git push origin master로 깃에 저장해주기