태그 보관물: git

git 에러 – fatal: refusing to merge unrelated histories

git pull을 하다 보면 다음과 같은 에러가 나올 때가 있습니다.

git pull
fatal: refusing to merge unrelated histories

이 에러는 로컬의 브랜치와 리모트의 브랜치를 서로 각각 init을 한 후에 pull이나 push할 때 생기는 에러입니다.

두 레파지토리에 서로 연관이 없는 히스토리가 들어 있다는 것인데

해결법은 히스토리 관계 검사를 무시하는 옵션을 추가해서 git pull을 하면 됩니다.

git pull origin main --allow-unrelated-histories

git 오류 fatal: unable to connect to cache daemon: Permission denied

git pull 또는 push를 할 때 다음과 같은 오류가 나오는 경우가 있습니다.

fatal: unable to connect to cache daemon: Permission denied

sudo를 사용하거나 권한을 잘못 변경하고 git를 사용하다가 발생한 문제인데 ~/.cach/git/credential 디렉토리의 권한을 현재 사용자에게 소유권을 다시 넘겨주면 해결됩니다.

다음과 같이 합니다.

sudo chown $(whoami) ~/.cache/git/credential/