Git 저장소 개념

2021. 4. 23. 18:03Git

반응형
  • 원격 저장소 협업
    • origin : 내 git 저장소(fork한 경우 포함)
    • upstream : fork한 원본 프로젝트 저장소
    • master : default branch

 

원본 프로젝트 저장소(upstream)

(fork) → (push/pull)

원격 저장소(origin) - branch(master, develop, release, feature…)

(clone) → (push/pull)

로컬 저장소(local) - branch(master, develop, feature/September…)

 

참고 url : https://www.pincoin.co.kr/book/2/48/#push

Git rebase 참고 url : https://junwoo45.github.io/2019-10-23-rebase/

 

 

reset -hard 복구를 위한 backup branch 생성

    git reflog → 복구할 commit 지점 확인  

    git checkout [해시코드] or [Head@{number}] → detached head 상태가 됨  

    git branch backup → head를 붙일 branch 생성  

    git checkout backup → attach head  

 

참고 url : https://velog.io/@sonypark/reset-hard로-삭제한-커밋-git-reflog를-이용해-살리기

반응형

'Git' 카테고리의 다른 글

git rebase 기준 브랜치 / 대상 브랜치  (0) 2025.06.20
SubModule 추가  (1) 2022.07.30
fetch 이해하기  (0) 2022.01.26
rebase 이해하기  (0) 2022.01.18
Graph에서 Branch 분기가 나타나지 않을 때  (0) 2021.04.23