Unity는 씬과 프리팹 파일을 구문상 올바르게 병합할 수 있는 UnityYAMLMerge라는 툴을 내장하고 있습니다. 툴은 커맨드 라인에서 접근이 가능하며 타사 버전 관리 소프트웨어에서도 사용할 수 있습니다.
Editor(메뉴: Edit > Project Settings 로 이동한 다음 Editor 카테고리 선택) 창에는 타사의 버전 관리 툴(예: Perforce 또는 PlasticSCM)을 선택할 수 있는 옵션이 있습니다. 툴 중 하나가 활성화되면 Version Control 제목 아래에 Smart Merge 메뉴가 나타납니다. 메뉴에는 네 가지 옵션이 있습니다.
UnityYAMLMerge 툴은 Unity 에디터에 내장되어 있습니다. Unity가 표준 위치에 설치되어 있을 경우 UnityYAMLMerge의 경로는 다음과 같습니다.
C:\\Program Files\\Unity\\Editor\\Data\\Tools\\UnityYAMLMerge.exe
또는
C:\\Program Files (x86)\\Unity\\Editor\\Data\\Tools\\UnityYAMLMerge.exe
Windows에서는 위와 같으며
/Applications/Unity/Unity.app/Contents/Tools/UnityYAMLMerge
Mac OSX에서는 위와 같습니다(폴더에 접근하려면 파인더(Finder)에서 패키지 콘텐츠 보기 커맨드를 사용해야 합니다).
UnityYAMLMerge에는 디폴트 폴백(fallback) 파일이 내장되어 있습니다(mergespecfile.txt라는 파일로 마찬가지로 Tools 폴더에 있습니다). 이 파일은 미해결 충돌 또는 알려지지 않은 파일을 어떻게 처리해야 할지 지정합니다. 또한 이를 통해 자동으로 파일 확장자에 따라 버전 관리 시스템(예: git)에 대한 병합 툴을 선택하지 않는 경우에 주 병합 툴로 사용할 수 있습니다. 가장 일반적인 툴은 mergespecfile.txt에 이미 기본적으로 나열되어 있지만 파일을 편집하여 새 툴을 추가하거나 옵션을 변경할 수 있습니다.
UnityYAMLMerge는 스탠드얼론 툴로써 커맨드 라인에서 실행할 수 있습니다(인수 없이 실행하면 전체 사용법을 볼 수 있습니다). 일반 버전 관리 시스템용 셋업 방법은 아래와 같습니다.
.unity
를 입력합니다.merge -p %b %1 %2 %r
을 입력합니다.그런 다음 같은 절차에 따라 .prefab
확장자를 추가합니다.
.git
또는 .gitconfig
파일에 다음 텍스트를 추가해야 합니다.
[merge]
tool = unityyamlmerge
[mergetool "unityyamlmerge"]
trustExitCode = false
cmd = '<path to UnityYAMLMerge>' merge -p "$BASE" "$REMOTE" "$LOCAL" "$MERGED"
.hgrc
파일에 다음 텍스트를 추가해야 합니다.
[merge-patterns]
**.unity = unityyamlmerge
**.prefab = unityyamlmerge
[merge-tools]
unityyamlmerge.executable = <path to UnityYAMLMerge>
unityyamlmerge.args = merge -p --force $base $other $local $output
unityyamlmerge.checkprompt = True
unityyamlmerge.premerge = False
unityyamlmerge.binary = False
~/.subversion/config
파일에 다음을 추가해야 합니다.
[helpers]
merge-tool-cmd = <path to UnityYAMLMerge>
.unity
를 입력합니다. <path to UnityYAMLMerge> merge -p %base %theirs %mine %merged
그런 다음 같은 절차에 따라 .prefab
확장자를 추가합니다.
.unity
확장자를 추가합니다. <path to UnityYAMLMerge> merge -p "@basefile" "@sourcefile" "@destinationfile" "@output"
그런 다음 같은 절차에 따라 .prefab
확장자를 추가합니다.
merge -p $BASE $REMOTE $LOCAL $MERGED
을 입력합니다.Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.