Git

[Git] 강제 pull 하기

clolee 2023. 11. 2. 17:19

Git 강제 pull

 

1) remote repository에서 최신 commit 정보 가져와

2) head를 옮긴 후

3)받아오기

 

1. remote repository에서 최신 commit 정보 가져오기

git fetch --all

 

2. head를  해당 repository branch의 최신 commit을 가리키게 하기

git reset --hard origin/<branchname>
git reset --hard origin/master

 

3. local에 commit 을 병합

git pull

 

 

 

참고 :

https://frontdev.tistory.com/entry/GIT-Conflict%EC%B6%A9%EB%8F%8C-%EB%82%AC%EC%9D%84-%EB%95%8C-%EA%B0%95%EC%A0%9C%EB%A1%9C-Pull-%ED%95%98%EA%B8%B0

https://chanos.tistory.com/entry/GIT-git-pull-%EC%8B%9C-merge-%EC%98%A4%EB%A5%98-%EB%B0%9C%EC%83%9D%ED%96%88%EC%9D%84-%EB%95%8C-%EA%B0%95%EC%A0%9C%EB%A1%9C-%EB%8D%AE%EC%96%B4%EC%93%B0%EB%8A%94-%EB%B0%A9%EB%B2%95-git-fetch-reset-pull