D-27-Git

박초화·2024년 1월 28일
0
  1. git 설정 범위
  • user name & email
  • CRLF (End of Line)
  • Editor
  • Default Branch
  • Git 전체 설정 확인
git config --l
git config --list
  • Git 범위별 설정 확인
git config --l --show-origin
git config --list --show-origin
  • Git 항목별 설정 확인
git config <key>
  1. git 저장소 생성

  2. git init
    : 경로 폴더 안에서 git init 을 해야한다.

  3. Remote Repository URL

  4. git clone
    : clone 할 위치에서 clone

  • git clone with Token

  1. git status

  2. git add

  3. git commit

  4. git ignore

  • ignore 파일 생성
  1. git RM

  2. git MV

  • remote 저장소
  1. Remote 저장소 추가

  2. Remote 저장소 주소 수정

  3. Remote 저장소 이름 수정

  4. Remote 저장소 삭제

  5. Remote 저장소 정보 확인

  6. Remote 저장소 상세 정보 확인

  7. Pull

git pull

  1. Push
git push
  • git clone 로직
  1. git checkout
    : 특정 버전으로 이동
git checkout <commit_id>
  • git branch란?
  1. local의 branch list 보기
git branch
  1. remote의 branch list 보기
git branch -r
  1. remote,local 모두의 branch list 보기
git branch -a
  1. local branch 생성
git branch <branch_name>
  1. local branch 생성
git branch <branch_name>
  1. git branch 배포 - Remote
git push origin <branch_name>
  1. git branch 삭제 - local
git branch --delete <branch_name>
git branch -D <branch_name> -> 생성만 하고 merge 안한 상태에서 삭제하는 경우사용
  1. git branch 삭제 - remote
git push origin --delete <branch_name>
  1. git branch 간 이동
git checkout <branch_name>
  1. git branch 생성 & 이동
git checkout -b <branch_name>
  1. git Merge
  • conflict란?

  • conflict 해결

  • 바로 push 하지 말고 항상 pull 먼저 하는 습관이 좋다!

  • git tag 란?

  1. Tag 생성하기 - 현재버전
git tag <tag_name>
  1. Tag 목록 조회
git tag
  1. Tag 생성하기 - 특정버전
git tag <tag_name> <commit_id>
  1. Tag 배포하기 - Remote
git push origin <tag_name>
  1. Tag 상세보기
git show <tag_name>
  1. Tag 삭제하기 - Local
git tag --delete <tag_name>
profile
도전적인 개발자

0개의 댓글

관련 채용 정보