[git] 자주쓰는 Git 명령어
#git remote URL 주소확인
git remote -v
#git branch 변경
git checkout branch_name
#git branch 삭제
git checkout -D branch_name
#remote URL 변경
$ git remote set-url origin https://github.com/900gle/shopping.git
$ git remote set-url origin https://900gle@github.com/900gle/ws-admin-new.git
계정정보 입력하라고 하면??
1. Credential 정보 저장
#> git config credential.helper store
credential.helper의 store 옵션을 주게되면 해당 git directory에선 반영구적으로 인증 절차가 생략됩니다.(저장된 credential 정보를 이용해 인증 처리)
2. 캐시 저장
#> git config credential.helper cache
임시로 일정 시간동안 저장하기에는 cache 가 더욱 유용합니다. cache 옵션을 주게되면 기본적으로 15분 동안 인증 절차를 요구하지 않습니다.
시간은 timeout 옵션으로 지정해줄 수 있습니다. (초 단위이며 아래와 같이 지정 시 3600초, 즉 1시간의 유효시간을 가집니다)
#> git config credential.helper 'cache --timeout=3600'
모드 프로젝트에 적용
git config의 공통적인 설정과 같이 --global 옵션을 주게되면 해당 git directory 이외에 모든 git 활동에서 저장된 정보를 이용하게 됩니다.
#> git config credential.helper store --global