could not lock config file /pathto/file/.gitconfig: No such file or directory

jimmy neutron·2023년 2월 10일

trouble shooting

목록 보기
1/1

에러 설명

cra로 프로젝트를 생성하고 깃에 연동해서 commit/push를 하려는데 에러가 발생했다.

could not lock config file /C:/NoahPc/.gitconfig: No such file or directory

윈도우 사용자 이름을 한국어로 설정했다가 영어로 바꾼적이 있었는데 지금은 다시 한국어로 사용하고 있기 때문에 경로 자체를 못찾는 문제였다.

해결 방법

git config를 실행할 때 $HOME 변수가 제대로 설정되어있는지 확인해도 되지만 더 쉬운 방법이 있었다.
git bash를 관리자권한으로 실행 후 명령어를 입력해주면 된다.

Quick fix:
Under windows open git bash as administrator

Step by step:
1. Open Windows search
2. Type: Git Bash
3. Click second mouse button and select: Run as administrator

  1. Go to your project directory:
cd "C:\path\to\our\project\name"
  1. Execute command:
git config --global user.email "qny123@naver.com"
profile
프론트엔드로 지구정복

0개의 댓글