Git & GitHub 완전 정복 (ongoing)

써니·2020년 12월 2일
0

gitandgithub

목록 보기
1/1

Git

  1. 등록하기
  2. 원격 연결

GitHub

  1. repository
  2. collaborator
  3. clone
  • https
  git clone "link" //링크는 paste
  • ssh (공부 더해야 됨)
  1. commit, push, pull, fetch?!?
  git commit //vs code에서 버튼 이미지 삽입 
  • git push

  • git pull and fetch difference 공부

  • **stage 공부

  1. branch관리
  • dev/master <- backup (default branch 따로 지정 가능), branch따서 개발
  • branch 만들기 / 삭제
    (@git bash, @vs code)
    --> GIT GRAPH
  1. merge, pull request

Fork한 repository 최신으로 버전으로 업그레이드 하기 (feat. upstream)

  • 원본 소스에서 fork해 온 repo는 별개이기 때문에 원본 소스가 갱신되어도 fork해놓은 브랜치는 예전 상태로 멈춰있음 (아무리 pull&fetch해도 소용없다 이말이야~)
  • 이 상황에서 소스를 수정하고 pull request하면 충돌 발생!!!
    Solution
  • upstream 등록
    git remote add upstream https://원본 리포 클론 링크
    git remote -v //추가 여부 확인
    git fetch upstream //원본 소스코드의 내용을 로컬로 내려받음
  • upstream으로 동기화
    git merge upstream/master //혹은 해당 remote 리포

충돌이라고? (내가 작업한 파일의 원본이 현재 최신버전의 파일 상태와 다를 때!)

https://webstudynote.tistory.com/116

0개의 댓글