카테고리 없음

[git] 다른 브랜치의 특정 파일만 patch 하기

냐옴 2022. 10. 26. 23:05

dev 브랜치의 style.css 파일을 현재 브랜치로 패치한다

## dev 브랜치의 style.css 파일을 현재 브랜치로 패치한다
$ git checkout -p dev style.css

(1/1) Apply addition to index and worktree [y,n,q,a,d,e,?]? ?
y - apply this hunk to index and worktree
n - do not apply this hunk to index and worktree
q - quit; do not apply this hunk or any of the remaining ones
a - apply this hunk and all later hunks in the file
d - do not apply this hunk or any of the later hunks in the file
e - manually edit the current hunk
? - print help

 

 

다른 브랜치의 파일을 현재 브랜치로 덮어쓴다

# dev 브랜치의 style.css 파일을 현재 브랜치로 덮어쓴다
$ git checkout dev -- style.css