1. 특정 파일만 머지하기
- 가져올 파일이 있는 브랜치 : branchB
git checkout -p branchB -- 머지할 파일 경로
※ 이 기능은 머지가 아니라 패치이므로 현재 브랜치의 수정 내역과는 관계 없이 해당 파일의 내용으로 변경된다
2. 특정 파일만 제외하고 나머지 머지하기
- 현재 작업중인 브랜치 : branchA
- 가져올 파일이 있는 브랜치 : branchB
git merge --no-commit --no-ff branchB -X theirs
git reset HEAD 제외할 파일
git clean -fd
git commit
728x90
'Git' 카테고리의 다른 글
[git] remote branch 가져오기 (0) | 2022.03.11 |
---|---|
[git] 리모트 저장소와 브랜치 최신화 하기 (0) | 2021.12.03 |
[error] Pulling is not possible because you have unmerged files. (0) | 2021.08.26 |
[error] The project you were looking for could not be found or you don't have permission to view it. (0) | 2021.08.07 |
[error]This is probably not a problem with npm. There is likely additional logging output above. (0) | 2021.03.08 |