git-error

29._.been·2020년 3월 5일
0

깃허브

목록 보기
1/7
post-thumbnail

github 사용방법

  1. cd (폴더)에서 git init 하기
  2. 깃허브 들어와서 repository 만들기
  3. repository 주소 복사한 뒤에 git remote add origin 레파지토리주소 하기
  4. git status로 파일 목록 빨간 글씨로 뜨는지 확인하기
  5. git add .해서 모든 파일 올릴 준비(스테이징)하기
  6. git commit -m "하고 싶은 말" 쓰고 커밋하기
  7. git push origin master 하기

error : refusing to merge unrelated histories

push를 했을때 error: failed to push some refs to "레파지토리 주소"
이런식으로 에러가 난다면
push 전에 먼저 pull을 해서 프로젝트를 병합해 주어야 한다.

하지만 pull명령 실행시 error: refusing to merge unrelated histories
이런 문구와 함께 진행되지 않는다면

git pull origin master --allow-unrelated-histories

명령어를 사용하면 된다.
이 명령은 이미 존재하는 두 프로젝트의 기록(history)저장 상황에 사용된다.
git은 서로 관련이 없는 다른 두 프로젝트를 merge할때 거부하기 때문에
git pull orign master --allow-unrelated-histories 명령어로 허용해준다.

profile
이규빈

0개의 댓글