[git] fork한 Repo 강제로 upstream과 동기화 시키기

Tabber·2021년 11월 2일
0

TIL

목록 보기
2/3

git과 친하지 않는 나로써는 한줄한줄 코드를 입력할 때마다 무서웠다.

그래서 그나마 작동하는 코드를 남기기로 했다.

내가 나중에 볼 것

git remote add upstream https://github.com/some_user/some_repo
git fetch upstream
git checkout master
git reset --hard upstream/master  
git push origin master --force

이렇게 하면 upstream의 마지막 커밋을 가져와서 그대로 내 fork에 업데이트 시키는 것 같다.

나중에 모르면 확인하자!

profile
iOS 정복중인 Tabber 입니다.

0개의 댓글