文章目录
修改密码
打开P4Admin
在Administraction>Change Password中修改密码
密码要求:
- 至少8位
- 包含大小写
- 以及至少一个特殊字符
新建用户
依然是在P4Admin中进行
设置用户信息以及所属组
这样我们就拥有新的用户了
新建Workspace
什么是Workspace
Perforce中的Workspace可以理解为项目资源的一个本地拷贝
打开P4V
点击New Workspace
设置workspace的名称和根目录
根据需要进行Advanced
设置,然后点击OK
这时会弹出一个添加文件向导,不需要的话直接点Cancel就可以
这时我们在P4V中就可以看到刚刚创建的名为UEGame的workspace了
设置Perforce的文件类型映射(Type Map)
切换到Depot标签在spec下面的"typemap.p4s"就是文件类型映射文件
这个spec文件夹是workspace配置文件所在的目录
这个步骤非常重要,可以说是Perforce的精髓,它就是要告诉Perforce那些文件是文本类型哪些是二进制类型
现在"typemap.p4s"上右键获取最新版本,把它从服务器端拉取到本地
然后双击它用记事本打开
C:/Windows/System32/notepad.exe
"typemap.p4s"默认的内容
# The form data below was edited by p4admin
# Perforce File Type Mapping Specifications.
#
# TypeMap: a list of filetype mappings; one per line.
# Each line has two elements:
#
# Filetype: The filetype to use on 'p4 add'.
#
# Path: File pattern which will use this filetype.
#
# See 'p4 help typemap' for more information.
TypeMap:
text //....asp
text //....cnf
text //....css
text //....htm
text //....html
text //....inc
text //....js
text+w //....log
text+w //....ini
text+w //....pdm
binary+Fl //....zip
binary+Fl //....bz2
binary+Fl //....rar
binary+Fl //....gz
binary+Fl //....avi
binary+Fl //....jpg
binary+Fl //....jpeg
binary+Fl //....mpg
binary+Fl //....gif
binary+Fl //....tif
binary+Fl //....mov
binary+Fl //....jar
binary+l //....ico
binary+l //....exp
binary+l //....btr
binary+l //....bmp
binary+l //....doc
binary+l //....dot
binary+l //....xls
binary+l //....ppt
binary+l //....pdf
binary+l //....tar
binary+l //....exe
binary+l //....dll
binary+l //....lib
binary+l //....bin
binary+l //....class
binary+l //....war
binary+l //....ear
binary+l //....so
binary+l //....rpt
binary+l //....cfm
binary+l //....ma
binary+l //....mb
binary+l //....pac
binary+l //....m4a
binary+l //....mp4
binary+l //....aac
binary+l //....wma
binary+l //....docx
binary+l //....pptx
binary+l //....xlsx
binary+l //....png
binary+l //....raw
binary+l //....odt
binary+l //....ods
binary+l //....odg
binary+l //....odp
binary+l //....otg
binary+l //....ots
binary+l //....ott
binary+l //....psd
binary+l //....sxw
我们要把针对虚幻的设置添加进去
binary+S2w //....exe
binary+S2w //....dll
binary+S2w //....lib
binary+S2w //....app
binary+S2w //....dylib
binary+S2w //....stub
binary+S2w //....ipa
binary //....bmp
text //....ini
text //....config
text //....cpp
text //....h
text //....c
text //....cs
text //....m
text //....mm
text //....py
binary+l //....uasset
binary+l //....umap
binary+l //....upk
binary+l //....udk
添加完毕的样子
# The form data below was edited by p4admin
# Perforce File Type Mapping Specifications.
#
# TypeMap: a list of filetype mappings; one per line.
# Each line has two elements:
#
# Filetype: The filetype to use on 'p4 add'.
#
# Path: File pattern which will use this filetype.
#
# See 'p4 help typemap' for more information.
TypeMap:
text //....asp
text //....cnf
text //....css
text //....htm
text //....html
text //....inc
text //....js
text+w //....log
text+w //....ini
text+w //....pdm
binary+Fl //....zip
binary+Fl //....bz2
binary+Fl //....rar
binary+Fl //....gz
binary+Fl //....avi
binary+Fl //....jpg
binary+Fl //....jpeg
binary+Fl //....mpg
binary+Fl //....gif
binary+Fl //....tif
binary+Fl //....mov
binary+Fl //....jar
binary+l //....ico
binary+l //....exp
binary+l //....btr
binary+l //....bmp
binary+l //....doc
binary+l //....dot
binary+l //....xls
binary+l //....ppt
binary+l //....pdf
binary+l //....tar
binary+l //....exe
binary+l //....dll
binary+l //....lib
binary+l //....bin
binary+l //....class
binary+l //....war
binary+l //....ear
binary+l //....so
binary+l //....rpt
binary+l //....cfm
binary+l //....ma
binary+l //....mb
binary+l //....pac
binary+l //....m4a
binary+l //....mp4
binary+l //....aac
binary+l //....wma
binary+l //....docx
binary+l //....pptx
binary+l //....xlsx
binary+l //....png
binary+l //....raw
binary+l //....odt
binary+l //....ods
binary+l //....odg
binary+l //....odp
binary+l //....otg
binary+l //....ots
binary+l //....ott
binary+l //....psd
binary+l //....sxw
binary+S2w //....exe
binary+S2w //....dll
binary+S2w //....lib
binary+S2w //....app
binary+S2w //....dylib
binary+S2w //....stub
binary+S2w //....ipa
binary //....bmp
text //....ini
text //....config
text //....cpp
text //....h
text //....c
text //....cs
text //....m
text //....mm
text //....py
binary+l //....uasset
binary+l //....umap
binary+l //....upk
binary+l //....udk
设置忽略文件(.p4ignore)
在你的Workspace的根目录下创建一个 depot目录,然后新建一个文本文件并更名为".p4ignore"
然后把要忽略的文件和文件夹填写进去
Saved/
Intermediate/
DerivedDataCache/
*.pdb
obj/
*.vcxproj
*.sln
*-Debug.*
FileOpenOrder/
在这里打开命令窗口
然后运行p4 set P4IGNORE=.p4ignore
,将".p4ignore"指定为忽略文件。
然后可以运行一下p4 ignores
检查一下是否设置成功:
把".p4ignore"添加到更新列表里
提交
添加虚幻工程
把整个虚幻工程拷贝到depot目录下即可
和刚才提交".p4ignore"的方法一样,把整个GameContent文件加也Mark For Add
然后Submit
提交完毕后可以在Depot窗口看一下,我们可以看到文件已经全部提交到了服务器端
在虚幻编辑器中配置Perforce
双击*.uproject文件,打开虚幻编辑器
连接成功后Source Control的图标提示