您的位置:首页 > 移动开发 > IOS开发

ios 项目 .gitignore 文件配置

2017-09-07 16:27 393 查看
能够列入到代码版本控制的文件是有规定的,不能是编写的二进制文件、临时文件和用户特有的文件等。

本人用的xcode 是8.3.3版本

xcode4 以上版本,我认为必要的配置项为:

# Xcode
.DS_Store
build/
xcuserdata/
xcshareddata/
.idea/


如果是xcode 3 和xcode 4版本

文件考虑到了X code 3和4差别,需要过滤的文件多出一些

# Exclude the build directory

build/*
# Exclude temp nibs and swap files

*~.nib
*.swp

# Exclude OS X folder attributes
.DS_Store

# Exclude user-specific XCode 3 and 4 files

*.mode1
*.mode1v3
*.mode2v3

*.perspective
*.perspectivev3
*.pbxuser
*.xcworkspace
xcuserdata

# Exclude the build directory
build/*

# Exclude temp nibs and swap files

*~.nib

*.swp

# Exclude OS X folder attributes
.DS_Store

# Exclude user-specific XCode 3 and 4 files
*.mode1
*.mode1v3
*.mode2v3
*.perspective
*.perspectivev3
*.pbxuser

*.xcworkspace

xcuserdata


如果考虑适用于所有的Xcode工程,则需要使用git config命令配置git,在终端中执行git config命令:

 

$ git config –global core.excludesfile  ~/.gitignore

 

该命令会将配置信息写入到~/.gitconfig文件中,–global参数是配置全局信息,~/.gitignore说明文件是放置于当前用户目录下。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ios xcode .gitignore