기존에 사용하던 사용하던 폴더가 아닌 새로운 폴더에 remote를 하여 사용하려고 하면 에러가 발생한다.
remote 를 하고 pull 명령을 주면 다음과 같은 에러가 나타나며 작업이 완료되지 않는다.
Git fatal: refusing to merge unrelated histores
기존 폴더와 관련이 없는 폴더에서 깃허브에 커밋을 하려고 하면 깃이 거부하는 것이다.
새로 사용할 폴더로 가서 git bash로 접속한 후, 관련 없는 폴더를 허용해주면 된다.
$ git pull origin master --allow-unrelated-histories
그러나 나는 에러가 또 생겼다.
'origin' does not appear to be a git repository
내가 remote 할 때 origin이 아니라 다른 이름으로 설정해서 그렇다.
아래 명령어를 통해 내가 설정한 이름을 확인할 수 있다.
$ git remote -v
내가 설정한 이름은 Healthcare-sensor-interworking 이라는 것을 알 수 있다.
다시
$ git pull Healthcare-sensor-interworking master --allow-unrelated-histories
이제 pull을 할 수 있을 것이다 !
'etc' 카테고리의 다른 글
[eclipse] eclipse 삭제하기 (0) | 2022.06.30 |
---|---|
[MySQL] ERROR 1064 (42000): You have an error in your SQL syntax; (0) | 2022.06.27 |
[Git] git error - fatal: not a git repository (0) | 2022.06.15 |
[Git] error: pathspec 'main' did not match any file(s) known to git 해결법 (0) | 2022.03.17 |
[Git] Git Hub 사용하기 (0) | 2022.01.17 |