로컬에서 만료된 Github access token 갱신

아홉번째태양·2023년 5월 15일
0

Github의 personal access token을 이용해 레포를 클로닝한 경우, 해당 토큰을 이용해 푸쉬와 풀링이 계속 이루어진다. 따라서, 만료되거나 기타 다른 이유로 토큰을 재생성한 경우 이를 교체해주어야 이전처럼 remote repo로 작업 요청이 가능하다.

1. 현재 url 확인

$ git remote -v
origin	https://ghp_myoldtoken@github.com/my/repo.git (fetch)
origin	https://ghp_myoldtoken@github.com/my/repo.git (push)

2. 새로운 url 세팅

$ git remote set-url origin https://ghp_mynewtoken@github.com/my/repo.git

3. 바뀐 url 확인

$ git remote -v
origin	https://ghp_mynewtoken@github.com/my/repo.git (fetch)
origin	https://ghp_mynewtoken@github.com/my/repo.git (push)

0개의 댓글