모든 원격 저장소에서 삭제된 브랜치를 로컬에서 정리

git fetch --all --prune

Discard all

git reset --hard
git clean -fxd

Branch 목록 보기

# 로컬 저장소
git branch

# 원격 저장소
git branch -r

체크아웃

git checkout

# 브랜치 생성과 체크아웃을 한번에
git checkout -b [브랜치명]
  1. GitHub로 블로그 만들 때 테마 제공해주는 사이트

Git Hub에서 코드 복사해오기

git clone <repository> <destination>

Git username, password 저장 방법

# 이전 세팅 reset
git config --unset credential.helper
# 전체에 공통 유저이름과 비밀번호를 저장하고 싶으면 –global 메뉴를 붙여준다.
git config --global credential.helper store

# 그리고 나서 다음 명령어를 실행한다.
git pull

# 이제 마지막으로 username 과 password 를 입력하면 저장이 된다.
  1. CI/CD commit timeout 시간 늘리기

    1) Settings > CI/CD > General pipelines

  2. 새로운 PC에 Git init할 때 내 아이디 초기화

git config --global user.email [email protected]
git config --global user.name gorani

  1. 새로운 PC에서 Git Lab 에 접근할 때 ssh key 설정하기
# ssh key 생성
ssh-keygen -t rsa -C <email>
# 다음 명령어를 쳤을 때 나오는 것 복사 후 GitLab 들어가서 settings->SSH Keys 들어가서 붙여넣기
cat ~/.ssh/id_rsa.pub

Two-Factor Authentication으로 Github desktop 인증하기