프로그래밍

잘 쓰던 github desktop이 visual studio 2019 설치 후 문제 생긴 경우

panpro 2019. 8. 18. 07:55

github를 잘 쓰고 있었는데 

visual studio 2019 설치 후 이런 메시지가 나오면서 commit이 안되는 문제가 생겨 해결해 보았습니다. 

 

메시지는 github 소유권이 의심스러워 보안상의 이유로  커밋을 취소했다는 건데, 

이 문제를 해결하기 위한 방법도 아래에 나와 있습니다. 

 

그런데 cmd 실행해서 저렇게 git 어쩌고 쳐보면 git을 따로 설치하지 않았기 때문에 git 이란 게 없다고 나옵니다. 

 

git이 설치된 위치를 찾아가야 하는데 제 경우는

 

C:\Users\USERID\AppData\Local\GitHubDesktop\app-2.1.1\resources\app\git\mingw64\bin\

 

폴더에 있네요. 

 

cmd를 관리자 모드로 실행시키고(이거 꼭 이렇게 해야하는지는 모르겠음)

 

C:\Users\USERID\AppData\Local\GitHubDesktop\app-2.1.1\resources\app\git\mingw64\bin\git config --global user.email "githubemail@example.com"

 

과 같이 입력해 주면 될 거 같은데, 

 

warning: 'C:\ProgramData/Git/config' has a dubious owner: '(unknown)'.
For security reasons, it is therefore ignored.
To fix this, please transfer ownership to an admininstrator.

 

저렇게 입력하고 나면 또 위와 같은 메시지가 나와요. 

입력이 안되었나 하고 또 해봐도 또 같은 메시지.

 

혹시나 해서 다시 commit해봐도 역시 맨 처음 그림과 같은 메시지가 나오면서 안되네요.

 

그래서 아래와 같이 해 보니  

 

git config --global --list

 

user.name이  비어 있네요. 

그래서 user.name을 넣어 줬습니다. 

 

C:\Users\USERID\AppData\Local\GitHubDesktop\app-2.1.1\resources\app\git\mingw64\bin\git config --global user.name "firstname lastname"

 

과 같이 넣어줬는데, 이래도 역시

 

warning: 'C:\ProgramData/Git/config' has a dubious owner: '(unknown)'. 
For security reasons, it is therefore ignored. 
To fix this, please transfer ownership to an admininstrator.

 

이 메시지가 나와요. 

 

음.. 그런데 이렇게 이름이 들어가 있으니 commit은 되네요.

 

 

결론. 

에러가 계속 되는거 같지만

 

git config --global user.email "githubemail@example.com"

git config --global user.name "firstname lastname"

 

를 해주면 commit을 할 수 있음.