본문 바로가기

TIL/Git5

Git | error: failed to push some refs to git init git add . git commit -m "first commit" git remote add origin http://~.git git push -u origin main >>error: failed to push some refs to 'http://~git' git add . git commit -m "test" git push >>fatal: The current branch master has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin master git push --set-upstream origin master //.. 2020. 12. 11.
Git | branch conflict 해결하기 git 브랜치 간 꼬였을 때 readme 수정, (충돌있는 파일) git add . git commit -m "Merge" git push origin main git checkout deploy git pull origin main 2020. 11. 23.
Git | revert git push 를 했더니 error: failed to push some refs to 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.. 2020. 10. 15.
Git | fatal: No such remote fatal: No such remote: 'xxx' 분명 xxx 저장소가 맞는데 이런 오류가 나왔다. 1) git remote set-url origin //해당 명령어로 origin 주소를 다시 설정한다. 2) git remote -v //설정된 주소를 확인한다. 3) git status 2020. 10. 15.
Git | fatal: remote origin already exists 폴더를 통째로 복사했다가 숨겨져 있던 .git 파일도 같이 복사되는 바람에 origin 저장소가 겹쳐 버렸다. error: src refspec master does not match any error: failed to push some refs to fatal: remote origin already exists. //원격저장소가 이미 존재한다는 뜻이므로 1) 'git remote -v' 명령어로 현재 origin 저장소를 확인한다. 2) 'git remote rm origin' 명령어로 origin 을 삭제 3) 'git intit' 으로 저장소 초기화 git add . git push 까지 원래 하려고 했던 레포지토리 초기 푸시 순서대로 입력한다. 2020. 10. 15.