#TIL #git 구식 branch를 최신으로 갱신하고 싶다면

$ git checkout master
$ git merge -s ours obsolete-branch

다른 브랜치 변경 사항을 무시한다. merge 커밋이 생길 수 있다는 것만 빼면 obsolete-branch를 지우고 다시 따는 것과 같다.

-s <strategy>

--strategy=<strategy>

Use the given merge strategy; can be supplied more than once to specify them in the order they should be tried. If there is no -s option, a built-in list of strategies is used instead (git merge-recursive when merging a single head, git merge-octopus otherwise).

https://git-scm.com/docs/git-merge

ours, theirs 용어는 항상 헷갈린다. ours는 현재 체크아웃한 브랜치고 theirs는 merge 대상 브랜치다.

Feedback plz <3 @ohyecloudy, ohyecloudy@gmail.com

A Random Post