문제
- vscode에서 이미
repository
로 사용중인 디렉토리의 상위 디렉토리에서 git init
을 선언했더니 vscode에서 github
자동 로그인이 풀려버렸다.
- 기존
repository
나 새로운 repository
에서 push
나 pull
을 하려고 하니 로그인하라는 텍스트가 계속 나왔다.
(project) root@98eddd6cf3a8:~/project/final-project-level3-cv-12
fatal: cannot run /opt/ml/.vscode-server/bin/dfd34e8260c270da74b5c2d86d61aee4b6d56977/extensions/git/dist/askpass.sh: No such file or directory
Username for 'https://github.com':
Password for 'https://zxcv5317@github.com':
해결 방법
1) password token
- 먼저
password token
을 github
홈페이지에 가서 준비해야한다.
github
> settings
> Developer settings
> Personal access tokens
에 들어가 Generate new token
버튼을 누른다.
Expiration
에 token
을 사용할 기간을 적고 밑에 체크박스를 용도에 맞게 체크해준다.
Generate token
버튼을 눌러주면 토큰이 생성된다.
- 창을 닫으면 한번 생성된 토큰은 다시 확인할 수 없으니 잘 적어두어야한다.
2) 자동로그인 설정
- 그냥 로그인을 하면
push
나 pull
을 할 때마다 아이디와 토큰값을 입력해주어야 한다.
- 이를 방지하기 위해 로그인하기 전 다음
command
를 실행해주어야 한다.
git config --global credential.helper store
3) Login
- 이제 다시
push
나 pull
을 실행하면 나오는 로그인 창에서 본인아이디와 받아온 token을 입력해주면 재로그인 필요없이 git
을 사용가능하다.
Username for 'https://github.com': $본인아이디
Password for 'https://zxcv5317@github.com': $받아온token