ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Git rebase
    Infra & Tools/GIT 2022. 3. 2. 11:42

    [branch = mt local ]

    git pull

    git add .

    git commit -m"df"

    git pull origin main 

    "merge 완료시 "

    git push

     

     

    commit = memo 를 남겨 만드는 시점 , 노드를 만든다고 봐도 된다.

    origin = remote repo url 

     

     kris  ~/Desktop/Solution-Challenge-2022-Chario-App   sunghyun >R>  git pull origin main
    https://github.com/DSCHUFS/Solution-Challenge-2022-Chario-App URL에서
     * branch            main       -> FETCH_HEAD
    fatal: It seems that there is already a rebase-merge directory, and
    I wonder if you are in the middle of another rebase.  If that is the
    case, please try
            git rebase (--continue | --abort | --skip)
    If that is not the case, please
            rm -fr ".git/rebase-merge"
    and run me again.  I am stopping in case you still have something
    valuable there.

    두개의 브랜치를 합치는 방법 merege   또는 rebase

    1. merege 

    • 병합을 하면 합쳐진 브랜치의 커밋 메시지가 중복으로 쌓이게 됩니다.
    • 커밋 순서를 바꾸지 않습니다.
    • 존재하는 브랜치가 변경되지 않습니다.
    • 새로운 merge commit을 생성합니다.
    •  
    • <<<<<<<< 과 ======= 사이에 표시된 내용은 merge를 실행한 브랜치에 있는 내용을 나타냅니다.(HEAD가 가리키고 있는 내용)
    • 반대로 ======= 과 <<<<<<<< 사이에 표시된 내용은 merge 하고자 하는 브랜치(즉, 병합할 브랜치 명)의 내용을 나타냅니다.

    2.git rebase

    작업한 feature 브랜치를 main 에 합치는 상황

    • 전체 브랜치를 마스터 브랜치 끝에 위치 시킵니다.
    •  master 브랜치의 기존의 마지막 커밋 뒤에 병합할 브랜치의 커밋들이 합쳐지게 하여 master 브랜치에 재배치(rebase) 하는 것을 말합니다.

    before rebase

     

     

    after rease

     

     

     

    깃 전체 커밋 히스토리 passwords.txt 파일 삭제 

    git filter-branch --tree-filter 'rm -f passwords.txt' HEAD
    
    
    
    
    깃 변경 관리 초기화
    
    git rm -r --cached .

     

     

     

     

     

    'Infra & Tools > GIT' 카테고리의 다른 글

    git branch clear , 모든 브랜치 삭제  (0) 2022.09.05
    Git stash 기초 설명  (0) 2022.09.05
    Git Hub 동시에 두개의 Repo 에 올리기!  (0) 2022.08.06
    GIT 파일 돌리기  (0) 2022.07.18
    깃 branch(feat Kraken)  (0) 2021.09.28
Designed by Tistory.