• Unity场景和代码合并以及UnityYAMLMerge的使用


    1.首先是.gitignore的配置。

    # Folder config file
    Desktop.ini
    
    # Recycle Bin used on file shares
    $RECYCLE.BIN/
    
    # Windows Installer files
    *.cab
    *.msi
    *.msm
    *.msp
    
    # Windows shortcuts
    *.lnk
    
    
    ### Unity ###
    /[Ll]ibrary/
    /[Tt]emp/
    /[Oo]bj/
    /[Bb]uild/
    /[Bb]uilds/
    /Assets/AssetStoreTools*
    
    
    # Folders designed to be part of repository, but not their content
    
    /_NonVersioned/*
    !/_NonVersioned/README.md
    
    /Assets/_NonVersioned/*
    !/Assets/_NonVersioned/README.md
    !/Assets/_NonVersioned/README.md.meta
    !/Assets/_NonVersioned.meta
    
    /Builds/*
    !/Builds/README.md
    
    # Files to be excluded
    
    ## Files generated by Visual Studio / MonoDevelop
    ExportedObj/
    obj/
    *.svd
    *.userprefs
    /*.csproj
    *.pidb
    *.suo
    /*.sln
    *.user
    *.unityproj
    *.booproj
    
    
    # Unity3D generated meta files
    *.pidb.meta
    
    ## Files generated by OS
    .DS_Store
    .DS_Store?
    ._*
    .Spotlight-V100
    .Trashes
    ehthumbs.db
    Thumbs.db
    
    # Unity3D Generated File On Crash Reports
    sysinfo.txt
    
    # Builds
    *.apk
    *.unitypackage

    2.然后是.gitattributes的配置(所有工程最开始就应该做好这两步)。

    * text=auto
    # keep lf on unity files
    *.asset text eol=lf
    *.meta text eol=lf
    *.prefab text eol=lf
    *.unity text eol=lf

    3.在菜单Edit > Project Settings > Editor中打开Inspector,将Asset Serialization部分的Mode改成Force Text。

    4.在SourceTree中设置如下选择 工具->选项->比较->外部差异对比合并->自定义->
    对比命令如下:D:Program FilesUnityEditorDataToolsUnityYAMLMerge.exe(找到自己电脑中UnityYAMLMerge.exe的路径) 参数如下:merge -p $BASE $REMOTE $LOCAL $MERGED

    5.在UnityYAMLMerge.exe所在的路径,找到mergespecfile.txt文件,修改合并命令。
    此项根据自己的需求修改,可以用下面推荐的N种方式。
    修改之前的合并命令如下:
    unity use "%programs%YouFallbackMergeToolForScenesHere.exe" "%l" "%r" "%b" "%d"
    prefab use "%programs%YouFallbackMergeToolForPrefabsHere.exe" "%l" "%r" "%b" "%d"

    修改之后的命令如下:
    #Araxis Merge
    unity use "%programs%AraxisAraxis Mergecompare.exe" /3 /a2 /wait /title1:"Other" /title2:"Base" /title3:"Local" "%l" "%b" "%r" "%d"
    prefab use "%programs%AraxisAraxis Mergecompare.exe" /3 /a2 /wait /title1:"Other" /title2:"Base" /title3:"Local" "%l" "%b" "%r" "%d"

    #Beyond Compare 4
    unity use "%programs%Beyond Compare 4comp.exe" "%l" "%b" "%r" "%d"
    prefab use "%programs%Beyond Compare 4comp.exe" "%l" "%b" "%r" "%d"

    6.合并说明:通常情况下第一栏是local分支,第二栏是base分支,第三栏是remote分支。

  • 相关阅读:
    Jenkins使用三:管理slave节点(配置SSH公钥和私钥)
    Jenkins使用二:新建任务
    Jenkins使用一:CentOS7安装Jenkins
    CentOS安装MongoDB
    测开之路七十八:shell之函数和参数
    测开之路七十七:shell之if、case、for、while
    测开之路七十六:linux变量和环境变量
    测开之路七十五:linux常用命令
    linux暴露端口可以被外部访问
    WEB框架概述(译)
  • 原文地址:https://www.cnblogs.com/txfd/p/9942812.html
Copyright © 2020-2023  润新知