git

김혁중·2022년 5월 14일
0

TIL

목록 보기
14/14

git 알지만 모르는 그대랄까?
다시 알아가보자...

  • branch 생성
    git branch <branch 이름>
    git branch feature

  • branch 목록
    git branch

  • branch 전환
    git switch <branch 이름>
    git switch feature

  • branch 삭제
    git branch -d <branch 이름>
    git branch -d feature

  • 힌트: 현재 브랜치의 끝이 리모트 브랜치보다 뒤에 있으므로 업데이트가 거부되었습니다.
    git push origin <branch 이름> --force
    git push origin feature --force

원격 저장소 내용으로 업데이트

  • 원격 저장소 확인
    git remote -v

  • fetch
    git fetch origin
    fetch를 통해 origin의 내용을 받아오기. 로컬 적용 X

  • merge
    git merge origin/main
    받아온 origin의 main branch 내용들을 내 로컬에 merge

profile
Digital Artist가 되고 싶은 초보 개발자

0개의 댓글