DrMaemi / blog

1 stars 0 forks source link

[Git] Authentication failed, remote: Invalid username or password #89

Open DrMaemi opened 1 year ago

DrMaemi commented 1 year ago

git 계정 비밀번호 변경 이후 git add, commit 명령어를 잘 실행한 뒤 push 할 때 제목의 오류가 발생했다.

git config --system --unset credential.helper

위 명령어를 실행했더니 아래와 같은 오류가 발생했다.

error: could not lock config file /etc/gitconfig: Permission denied

다음 명령어를 실행하면 된다.

git config --global --unset credential.helper
# 또는 --global 대신 system ? 뭔 차이일까

global config 설정에 오류가 있으면 config unset 할 때 --global 옵션을 줘야 하는 것 같다.

그럼 local config 설정에 오류가 있으면 --local 옵션을 줘야 할 것 같다.

어쨋든, 위 명령어 실행 후 push를 다시 해보면 username과 password를 다시 묻는다. 올바르게 입력하면 잘 된다.

참조