[문제의 에러]
1. 리모트에 로컬에 없는 사항이 들어 있으므로 업데이트가 거부되었습니다...
2. You have divergent branches and need to specify how to reconcile them...
힌트: 거부되었습니다. 이 상황은 보통 또 다른 저장소에서 같은
힌트: 저장소로 푸시할 때 발생합니다. 푸시하기 전에
힌트: ('git pull ...' 등 명령으로) 리모트 변경 사항을 먼저
힌트: 포함해야 합니다.
힌트: 자세한 정보는 'git push --help'의 "Note about fast-forwards' 부분을
힌트: 참고하십시오.
github에서 readme.md 파일을 만들어서 원격저장소에만 readme file이 있고, local에는 없어서 오류가 생겼다.
git pull origin master
git pull 해서 원격 저장소의 정보를 로컬 저장소로 가져오려 했다.
그런데 또 다시 에러가 발생했다.
힌트: You have divergent branches and need to specify how to reconcile them.
힌트: You can do so by running one of the following commands sometime before
힌트: your next pull:
힌트:
힌트: git config pull.rebase false # merge
힌트: git config pull.rebase true # rebase
힌트: git config pull.ff only # fast-forward only
힌트:
힌트: You can replace "git config" with "git config --global" to set a default
힌트: preference for all repositories. You can also pass --rebase, --no-rebase,
힌트: or --ff-only on the command line to override the configured default per
힌트: invocation.
fatal: Need to specify how to reconcile divergent branches.
검색해보니 Git v2.27 부터 나오는 메세지라고 한다.
git config pull.rebase false
위 입력 후 git push 해주니까 잘 올라가졌다.
git pull 하니 내 local에 github에서 작성했던 readme file이 생성됨
그래서 아까 못했던 git push도 잘 되었다!