我应该在 Swift 游乐场的 .gitignore 文件中包含什么?

What should I include in the .gitignore file for Swift playgrounds?

我想使用 Git 对我的游乐场进行版本控制,但我不确定应该忽略哪些文件以及应该提交哪些文件。

目前我使用以下 .gitignore 游乐场文件:

# Xcode user data
xcuserdata

还应该有什么?

来自官方github gitignore for Swift

## Playgrounds
timeline.xctimeline
playground.xcworkspace

无论是普通项目还是游乐场,使用Swift标准.gitignore文件之一既方便又实用。从终端 cd 进入您的项目根文件夹(带有 .xcodeproj 文件的普通项目)和 运行 以下命令:

curl -o .gitignore https://www.gitignore.io/api/swift

或者从 GitHub 来源获取:

curl -o .gitignore https://raw.githubusercontent.com/github/gitignore/master/Swift.gitignore

如果需要,您可以编辑文件进行更改。我只使用默认值。