Codestates/Pre-project

[Pre-project] git commit 원하는 것만 올리기가 안 될 때...

Tite 2022. 11. 1. 19:41

**** 원래 작업하던 폴더, 파일들 복사해서 잘 모셔두기!

 

  • 원격 레포에서 git clone 으로 새롭게 폴더를 가져온다 (ㅋㅋ...
  • git remote -v 로 원격 레포랑 연결 잘 되어있는 지 확인한다
  • 새로운 브런치를 파고 거기로 이동한다
    • git checkout -b <새로운브런치이름>

 

  • git pull (remote) dev-fe 로 pull 해온다
    • remote는 origin 일 수도 pre015일 수도 있음 2번에 확인 했을 때 뜨는 걸로

 

  • pull 후 병합과 오류를 수정한다...
  • 자신이 작성했던 파일, 폴더들을 git clone 으로 새로판 폴더에 다시 작성한다
  • 오류가 없는 걸 확인했다면      git push <remote> <아까 만들었던 새로운 브런치 이름>      한다! 

 

  • giithub 으로 가서 pr을 날린다

 

 


 

 

이렇게 했는데도 이상한 commit 들이 끼어있긴 하더라...

다음에 pull 해올 때 아래 같은 게 또 뜨면

 

git config pull.rebase false 가 아니라    (항상 얘로 했었음....)

git config pull.ff only 로 해 보던가 해야겠다.

 * branch            dev-fe     -> FETCH_HEAD
hint: You have divergent branches and need to specify how to reconcile them.
hint: You can do so by running one of the following commands sometime before
hint: your next pull:
hint: 
hint:   git config pull.rebase false  # merge
hint:   git config pull.rebase true   # rebase
hint:   git config pull.ff only       # fast-forward only
hint: 
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
fatal: Need to specify how to reconcile divergent branches.

 

 

 

 

**** 11/07 수정 ****

 

내가 작업한 거 pr 보내고, 머지하고 -> 아무것도 안하다가 -> 다른 분이 머지하신 거 받아올 때 git clone 부터 다시 해왔다 ㅋㅋㅋㅋ....

 

내거 머지하고 코드 작업 했으면

1) git clone 으로 새로 하나 파자

2) main 브랜치로 되어있으니까 브랜치 새로 파서

3) 거기서 pull 하고

4) 작업했던 코드들 넣는 식으로 하자...